0
У меня есть класс дротика писать так:передать переменную HTML страницы в Angular2js/Dart
@Component(selector: 'my-content', templateUrl: '../../views/example.html', directives: const [NgFor, NgIf, NgStyle, NgClass], pipes: const [LowerCasePipe, JoinByPipe])
class ContentComponent implements OnInit {
@Input()
ContentComponent(@Inject(ContentService) this.contentService, @Inject(LoggerService) this.log) {
}
@override
ngOnInit()
{
this.className = '.Ciao';
}
В example.html Я делаю это
<span class="pull-right channel" [ngClass]="{className}">some content</span>
Когда я строй этого проект Я принимаю это сообщение:
<span class="pull-right channel" [ERROR ->][ngClass]="{className}">some content</span>
который является правильным синтаксисом?
'@Inject (ContentService)' и '@Inject (LoggerService)' являются избыточными, если поля имеют один и тот же тип. –