Skip to content

Instantly share code, notes, and snippets.

@nbogie
Last active July 5, 2016 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbogie/8945ff714083545a95034a099645e9e8 to your computer and use it in GitHub Desktop.
Save nbogie/8945ff714083545a95034a099645e9e8 to your computer and use it in GitHub Desktop.
Attempted recreation of @anuteja 's problem.
//Working towards a minimal demonstration of the problem.
//This currently works as expected :(
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'problem',
styles: [`
.original { color: green; }
.different { color: orange; }
`],
template: `
<div *ngFor="let n of [1,2,10]" [ngClass]="myClass">
hello world {{n}}
</div>
<button (click)="changeClass()">Change Class</button>`
})
export class ProblemComponent {
myClass = "original";
changeClass() {
this.myClass = "different";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment