Move it to a class,
the init's are normal assignments in es6.
something like this will get you going:
class items {
price:number
describtion:String;
}
class chart {
shipping:number ;
taxRate:number;
items: items[];
total() { return items.reduce((total, item) => total + item.count *
item.price, 0) ; }
}
add the 'functions' to the class where they belong. also add all the
properties they need and use an @inject, yso Angular can use those as
services.
success.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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.