Created
July 8, 2017 02:34
-
-
Save afirdousi/deb6f11226dc6a0d99826407972d46b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'my-app', | |
template: ` | |
<div [ngClass]="theme"> | |
<h2>{{name}}</h2> | |
<div>Themes implemented</div> <br/><br/> | |
Select Theme : <a href="#" (click)="setTheme('light')">Light </a> | | |
<a href="#" (click)="setTheme('dark')">Dark</a> | | |
<a href="#" (click)="setTheme('')">No theme</a><br/><br/> | |
<p> <b>Current Theme : </b> {{ theme || 'none' }} </p> | |
<custom-input [placeholder]="'Your name ...'" ></custom-input> <br/> | |
<custom-button [text]="'Sign In'" [state]="'primary'" ></custom-button> | |
</div> | |
`, | |
}) | |
export class App { | |
name:string; | |
theme = ''; // No initial theme set | |
constructor() { | |
this.name = `Themeable Components - Part 2 - Angular! v${VERSION.full}` | |
} | |
setTheme(theme){ | |
this.theme = theme; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment