generator-angular2-library
generator-angular2-library copied to clipboard
Sample.service.ts not found
when i m creating object of sampleservice in the constructor of sample-component its giving error in the run time not giving error in compile time saying dat sample-service no found.
Error: Fetch error: 404 Not Found Instantiating http://localhost:3000/custom-keyboard.service Loading http://localhost:3000/dist/demo1.umd.js
working for me: ``import { Component } from '@angular/core'; import { LIST } from './providers/list'; import { MyCustomService } from './providers/custom-service';
@Component({
selector: 'sample-component',
template: <h1>Sample component</h1> <ul> <li *ngFor="let myObject of objectArray"> {{myObject.name}} - {{translate(myObject.name)}} </ul>
,
providers: [
MyCustomService
]
})
export class SampleComponent {
public myObjectArray = LIST;
constructor(private myCustomService: MyCustomService) { }
public translate(name) { return this.myCustomService.translate(name); }
}``