Also update dart_to_js_script_rewriter dependency to ^1.0.1, and change most angular2.dart imports to be core.dart instead. The pipes example broke without the angular2.dart import, so I let it be. The server-communication sample has never worked for me, so I changed it but might have broken it further. closes #1007
		
			
				
	
	
		
			32 lines
		
	
	
		
			768 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			768 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
// #docplaster
 | 
						|
// #docregion
 | 
						|
// #docregion unless-declaration
 | 
						|
import 'package:angular2/core.dart';
 | 
						|
// #enddocregion unless-declaration
 | 
						|
 | 
						|
// #docregion unless-declaration
 | 
						|
@Directive(selector: '[myUnless]')
 | 
						|
class UnlessDirective {
 | 
						|
  // #enddocregion unless-declaration
 | 
						|
 | 
						|
  // #docregion unless-constructor
 | 
						|
  TemplateRef _templateRef;
 | 
						|
  ViewContainerRef _viewContainer;
 | 
						|
 | 
						|
  UnlessDirective(this._templateRef, this._viewContainer);
 | 
						|
  // #enddocregion unless-constructor
 | 
						|
 | 
						|
  // #docregion unless-set
 | 
						|
  @Input()
 | 
						|
  set myUnless(bool condition) {
 | 
						|
    if (!condition) {
 | 
						|
      _viewContainer.createEmbeddedView(_templateRef);
 | 
						|
    } else {
 | 
						|
      _viewContainer.clear();
 | 
						|
    }
 | 
						|
  }
 | 
						|
  // #enddocregion unless-set
 | 
						|
  // #docregion unless-declaration
 | 
						|
}
 | 
						|
// #enddocregion unless-declaration
 |