×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nilesh Yadav
Added: Jun 14, 2017 7:12 AM
Views: 5
Tags: no tags
  1. import { Component } from '@angular/core';
  2.  
  3. @Component({
  4.         selector: 'my-tuts',
  5.         template:`<h2>{{title}}</h2>
  6.                                 <div [class.myClass]="applyclass"></div>
  7.                                 <div [style.color]="applyblue? 'blue':'orange'">this is style binding</div>`,
  8.         styles : [`.myClass{
  9.                 color:red;
  10.         }`]                    
  11. })
  12. export class TutsComponent{
  13.         public title="mytitle";
  14.         public applyclass = true;
  15.         public applyblue = true;
  16. }