#angular2:angular2 example
A basic example showing how to use *ng-if in angular2.
Main library: angular2:angular2
Main element: NgIf
Gist: https://gist.github.com/kasperpeulen/dd353c3d95b2da3dd74b
Tags: #ng-if
#angular2:angular2 example
A basic example showing how to use *ng-if in angular2.
Main library: angular2:angular2
Main element: NgIf
Gist: https://gist.github.com/kasperpeulen/dd353c3d95b2da3dd74b
Tags: #ng-if
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| </head> | |
| <body> | |
| <my-app></my-app> | |
| <script type="application/dart" src="main.dart"></script> | |
| </body> | |
| </html> | |
| import 'package:angular2/angular2.dart'; | |
| import 'package:angular2/src/reflection/reflection.dart' show reflector; | |
| import 'package:angular2/src/reflection/reflection_capabilities.dart' | |
| show ReflectionCapabilities; | |
| @Component(selector: 'my-app') | |
| @View(template: ''' | |
| <span *ng-if="1+1 == 2">1+1 is indeed 2, very smart!</span> | |
| ''', directives: const [NgIf]) | |
| class MyApp {} | |
| main() { | |
| reflector.reflectionCapabilities = new ReflectionCapabilities(); | |
| bootstrap(MyApp); | |
| } |
| name: angular2.angular2_NgIf | |
| description: > | |
| A basic example showing how to use *ng-if in angular2. | |
| tags: 'ng-if' | |
| homepage: https://gist.github.com/kasperpeulen/dd353c3d95b2da3dd74b | |
| environment: | |
| sdk: '>=1.0.0 <2.0.0' | |
| dependencies: | |
| angular2: 2.0.0-alpha.32 |