Skip to content

2.0.0 Can't bind to 'ngClass' since it isn't a known property of 'div'. #12240

@yaotaiyang

Description

@yaotaiyang
import {Component} from '@angular/core';
@Component({
    selector: 'left-nav',
    template:`
    <div [ngClass]="'first second'">aaaaabbbbbcccc</div>
    `
})
export class LeftNav {
    constructor(){}
}
Can't bind to 'ngClass' since it isn't a known property of 'div'. ("
    <div [ERROR ->][ngClass]="">aaaaabbbbbcccc</div>
    "): LeftNav@1:9

If I remove [ngClass]="'first second'" it works ok.

window 10
Angular version: 2.0.0
Browser: chrome
Language: TypeScript 2.0.2
Node (for AoT issues): 5.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions