I'm having this error message;
Thisindicatesthattheerrorishere;
<!--INíCIOdoCONTEÚDO--><sectionclass="content-header">
<h1>
Todos os Restaurantes
</h1>
</section>
<section class="content">
<div class="row">
<div *ngFor="let restaurant of restaurants" class="col-sm-6 col-xs-12">
<mt-restaurant [restaurant]="restaurant"></mt-restaurant>
</div>
</div>
</section>
This is my class of services;
@Injectable()
export class RestaurantService {
public url: String = 'http://localhost:3000/api/';
constructor(private http: Http) {
// this.url = environment.url;
}
restaurants(): Observable<Restaurant[]> {
return this.http.get('${this.url}/restaurants')
.map(response => response.json())
}
And this is my component class;
restaurants: Restaurant[]
constructor(private restaurantService: RestaurantService){}
ngOnInit() {
this.restaurantService.restaurants()
.subscribe(restaurants => this.restaurants = restaurants)
}
What can be wrong?