How to pass parameters using ui-sref in ui-router to controller

I’ve created an example to show how to. Updated state definition would be: And this would be the controller: What we can see is that the state home now has url defined as: which means, that the params in url are expected as These two links will correctly pass arguments into the controller: Also, the controller does consume $stateParams instead of $stateParam. … Read more

The preferred way of creating a new element with jQuery

The first option gives you more flexibilty: And of course .html(‘*’) overrides the content while .append(‘*’) doesn’t, but I guess, this wasn’t your question. Another good practice is prefixing your jQuery variables with $:Is there any specific reason behind using $ with variable in jQuery Placing quotes around the “class” property name will make it more compatible with less flexible browsers.

Failed to find a valid digest in the ‘integrity’ attribute for resource on a deployed emberjs application

Ember uses Subresource Integrity (SRI) by default to increase the security of applications built with the framework. The Mozilla Development Network has a good explanation of SRI: Subresource Integrity (SRI) is a security feature that enables browsers to verify that resources they fetch (for example, from a CDN) are delivered without unexpected manipulation. It works by allowing … Read more

How to get current date in jQuery?

Date() is not part of jQuery, it is one of JavaScript’s features. See the documentation on Date object. You can do it like that: See this jsfiddle for a proof. The code may look like a complex one, because it must deal with months & days being represented by numbers less than 10 (meaning the strings will have one char instead of … Read more