Угловая 2 Проблема с данными
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!
Что я уже пробовал:
Я попробовал изменить теги, проверил директивы, а также звонки, сделанные через интернет