Monday, September 5, 2016

In html side

<a our-click="save()">Save</a>

In angularjs side(JavaScript)

.directive('ourClick', function() {
     return function(scope, element, attrs) {
        event.stopPropagation();
          selement.bind('touchstart click', function(event) {
          event.preventDefault();
          cope.$apply(attrs.
ourClick);
        });
     };
});

state = false;
changeState(state){
state = true;
}
log(state);

In the above code
  • If we are passing by value, output is false
  • If we are passing by reference, out put is true.

See the simple example :

Sunday, September 4, 2016

Tilde(~) :
Tilde matches the most recent minor version (the middle number). ~1.1.1 will match all 1.1.x versions but will miss 1.2.0.
Caret(^) :
Caret matches the most recent major version (the first number). ^1.1.1 will match any 1.x.x release including 1.2.0, but will hold off on 2.0.0.

Note: Just use 0.0.x instead of ~0.0.0. The first is less obscure.

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered by Blogger.

Popular Posts