What is the equivalent of ngShow and ngHide in Angular 2+?

后端 未结 18 2368
离开以前
离开以前 2020-11-22 14:46

I have a number of elements that I want to be visible under certain conditions.

In AngularJS I would write

stuff
18条回答
  •  攒了一身酷
    2020-11-22 15:39

    To hide and show div on button click in angular 6.

    Html Code

    
    
    Name Ram

    Component .ts Code

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent{
     isShow=false;
      }
    

    this works for me and it is way to replace ng-hide and ng-show in angular6.

    enjoy...

    Thanks

提交回复
热议问题