question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
DzmitryShylovichcommented, Oct 12, 2016

Import CommonModule.

This issue doesn’t fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular.

If you are wondering why we don’t resolve support issues via the issue tracker, please check out this explanation.

4reactions
chitresh14commented, Nov 11, 2018

Try with [ngClass]=“first second” .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bind to 'ngClass' since it isn't a known property of 'input ...
Show activity on this post. In my project I'm using lazy loading So, In my registration module I'm using [ngClass] directive to add...
Read more >
Common errors in Angular: Can't bind to since it isn't a known ...
Ever made an Angular application , opened your console and saw an error message similar to: “Can't bind to ngclass since it isn't...
Read more >
can't bind to 'options' since it isn't a known property of 'span ...
If 'md-input' is an Angular component and it has 'type' input, then verify that it is part of this module. If 'md-input' is...
Read more >
angular/angular-cli - Gitter
I'm trying to upgrade to rc.6 and have a problem i can't seem to fix Unhandled ... errors: Can't bind to 'ngClass' since...
Read more >
ngStyle refuses to work because "it isn't a known property of div"
FYI, when you do see that error message, it means something isn't imported correctly. In this case, CommonModule wasn't being imported, probably ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found