My doubt is the following one I have two components one of presentation and another container in angular 9, when I try to import the component of presentation in the component container gives me a syntax error I would appreciate your help to solve the problem. Thanks
current-weather.component.ts
import { Component, OnInit } from '@angular/core';
import { CurrentWeatherService } from '../services/current-weather.service';
@Component({
selector: 'app-current-weather',
templateUrl: './current-weather.component.html',
styleUrls: ['./current-weather.component.scss'],
})
export class CurrentWeatherComponent implements OnInit {
constructor(public weatherService: CurrentWeatherService) {}
ngOnInit() {
}
}
weather-card.component.ts
import { Component, OnInit, Input } from '@angular/core';
import { Weather } from 'src/structures/weather.structure';
@Component({
selector: 'app-weather-card',
templateUrl: './weather-card.component.html',
styleUrls: ['./weather-card.component.scss']
})
export class WeatherCardComponent implements OnInit {
@Input() weather : Weather;
constructor() { }
ngOnInit(): void {
}
}
current-weather.component.html
<app-weather-card [weather]="weatherService.weather$ | async as weather" ></app-weather-card>
ERROR in Template parse errors: Parser Error: Unexpected token 'as' at column 33 in [weatherService.weather$ | async as weather] in C:/Projects/projects-angular/weatherapp/src/app/current-weather/current-weather.component.html@0:29 ("]weatherService.weather$ | async as weather" >"): C:/Projects/projects-angular/weatherapp/src/app/current-weather/current-weather.component.html@0:29
as weather?