*Hello all ! I would like to know how I can to add/push a row in the
example of heroes and crisis *
*function CrisisService($q) { var crisesPromise = $q.when([ {id: 1,
name: 'Princess Held Captive'}, {id: 2, name: 'Dragon Burning Cities'},
{id: 3, name: 'Giant Asteroid Heading For Earth'}, {id: 4, name:
'Release Deadline Looms'} ]); this.getCrises = function() { return
crisesPromise; }; this.getCrisis = function(id) { return
crisesPromise.then(function(crises) { for(var i=0; i<crises.length;
i++) { if ( crises[i].id == id) return crises[i]; } });
};}function CrisisListComponent(crisisService) { var selectedId = null;
var ctrl = this; this.$routerOnActivate = function(next) {
console.log('$routerOnActivate', this, arguments); // Load up the crises
for this view crisisService.getCrises().then(function(crises) {
ctrl.crises = crises; selectedId = next.params.id; }); };
this.isSelected = function(crisis) { return (crisis.id == selectedId);
}; this.onSelect = function(crisis) {
this.$router.navigate(['CrisisDetail', { id: crisis.id }]); };}*
*thank you for your answers :)*
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.