Skip to main content

How to use ngClass in angular?

ngClass Using String Syntax

This is the simplest way to use ngClass. You can just add an Angular variable to

ng-class and that is the class that will be used for that elements for example -

<div ng-class="textType">Look at me
</div>

Then in component CSS write CSS for textType class
Like as 
.textType{
color:red;
}

Comments

Popular posts from this blog

Create module and component in angular by CLI

To create a component as part of a module you should ng g module newModule  to generate a module, cd newModule  to change directory into the  newModule  folder ng g component newComponent  to create a component as a child of the module.

Difference between full stack developer and minstack developer

 Full stack  Developer is that person who can develop client and server side applications like client means fronthand UI(html , CSS, angular materials , bootstrap etc) interface that communicate to server . Server means where handle the client request and create business logic and prepare the database that is server part . In simple and sort language server is a backhand  part. Who knows server side languages like java ,PHP , .net ,nodejs python etc  A minstack is that developer who knows only JavaScript. Based  application programmer like as nodejs, angularjs , mongodb expressjs , reactjs etc