r/angularjs • • Dec 15 '15

Angular 2 Beta is here!!

http://angularjs.blogspot.com/2015/12/angular-2-beta.html
97 Upvotes

46 comments sorted by

View all comments

6

u/[deleted] Dec 15 '15

Hide your kids hide your wife

20

u/akujinhikari Dec 15 '15

<kids ng-hide="true"></kids>

<wife ng-hide="true"></wife>

24

u/synalx Dec 15 '15

Nope, now it's:

<kids *ngIf="false"></kids>
<wife *ngIf="false"></wife>

:)

3

u/akujinhikari Dec 15 '15

Was gonna actually type that, but I wasn't sure if anyone would get it yet. ha ha

1

u/Xerxero Dec 16 '15

Are you sure about the *

1

u/synalx Dec 16 '15

Indeed.

<kids *ngIf="false"></kids>

desugars to

<template [ng-if]="false">
  <kids></kids>
</template>

which is how NgIf works in Angular2. The template is rendered or not depending on the expression.