I have a component which is properly being called from the .ts file but it's still not returning the data. And have a service import {Component} from 'angular2/core' import {AuthorServices} from './author.service' @Component ({ selector: 'author', template: ` <h1>Authors</h1> {{title}} <ul> <li ngFor ="#auth of author"> {{auth}} </li> </ul> `, providers: [AuthorServices]}) export class AuthorComponent{ title ="Name of Author"; authors; constructor(authorServices : AuthorServices){ this.authors = authorServices.getAuthor(); } } export class AuthorServices{ getAuthor(): string[]{ return ['Paul','Eva','Nicholas']; }} It should return array along with its title. But I am not sure where it's getting stuck. Please Help!
<ul> <li *ngFor="let auth of authors"> {{auth}} </li> </ul>
authors
author
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)