You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -498,7 +498,7 @@ The functions/methods available to us without any further modification are:
498
498
4. `.$remove()` which does a DELETE request.
499
499
5. `.$delete()` which does a DELETE request.
500
500
The getters and the deleters, `.get()`, `.query()`, `.$remove()` and `.$delete()` can be passed a callback function with `(value,headers)` and the error callback is passed with `httpResponse` argument.
501
-
A full example of this would be `UserProfile.get({id:1}, function(data){/*do success stuff*/}, function(response){/*handle error*/}.
501
+
A full example of this would be `UserProfile.get({id:1}, function(data){/*do success stuff*/}, function(response){/*handle error*/})`.
502
502
The setter `.$save()` is called with some data to be posted and has the same success/error callback pattern.
503
503
A full example of this would be:
504
504
`Notes.$save({noteId:2, author:'Camillo'}, "This is an amazing note wow", successCallback, errorCallback)`
What is the difference between `$emit` and `$broadcast`? As mentioned previously `$emit`propogates the event upwards and all controllers listening for`myEventName`in the parent scopes will be alerted. `$broadcast` does the opposite and propagates the eventdownwards. Note that both these events will also execute in their own scopes.
544
+
What is the difference between `$emit` and `$broadcast`? As mentioned previously `$emit`propagates the event upwards and all controllers listening for`myEventName`in the parent scopes will be alerted. `$broadcast` does the opposite and propagates the eventdownwards. Note that both these events will also execute in their own scopes.
545
545
546
546
Anewexample here [08-2-onEmitBroadcast.html](https://github.com/zafarali/learning-angular/blob/master/08-2-onEmitBroadcast.html) demonstrates this. Remember that declaring a new controller automatically creates a new scope. The page is also demonstrates inherited scopes and overriding properties.
547
547
I've realized that this is one of AngularJS' most powerful feature.
0 commit comments