you need to add the service to the providers array in your module definition.
On May 25, 2017 14:00, "Bernd Wachter" <[email protected]> wrote: > Hello, > > i have this Class in my Angular 4 Project when i call this function from > another Service class > > let newItem = this.item(id, name, price, quantity, data, imagePath); > > and want to give the Parameters to the Item Class > > i become always the Error: > ERROR Error: Uncaught (in promise): Error: No provider for Number! > > > > import { Injectable } from '@angular/core'; > > @Injectable() > export class Item { > constructor(private id: number, > private articleId: string, > private name: string, > private price: string, > private quantity: number, > private data: string, > private imagePath: string){} > > } > > > > > what i do wrong here ? > i want to give the Parameters to the Item Class and make there some > Calculations > and want to give a Array with the calculated Data back... > > Thanks for help > Benny > > -- > 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. > -- 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.
