From 78d3f62b6a38b00f1ef3dec4c1d31e8ceebdedcb Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 11 May 2015 16:00:53 -0700 Subject: [PATCH] chore: rename non-bindable to ng-non-bindable --- modules/angular2/directives.js | 6 +++--- .../directives/{non_bindable.js => ng_non_bindable.js} | 6 +++--- modules/angular2/test/directives/non_bindable_spec.js | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) rename modules/angular2/src/directives/{non_bindable.js => ng_non_bindable.js} (77%) diff --git a/modules/angular2/directives.js b/modules/angular2/directives.js index b17a413e41..517128bc40 100644 --- a/modules/angular2/directives.js +++ b/modules/angular2/directives.js @@ -8,13 +8,13 @@ import {CONST_EXPR} from './src/facade/lang'; import {For} from './src/directives/for'; import {NgIf} from './src/directives/ng_if'; -import {NonBindable} from './src/directives/non_bindable'; +import {NgNonBindable} from './src/directives/ng_non_bindable'; import {Switch, SwitchWhen, SwitchDefault} from './src/directives/switch'; export * from './src/directives/class'; export * from './src/directives/for'; export * from './src/directives/ng_if'; -export * from './src/directives/non_bindable'; +export * from './src/directives/ng_non_bindable'; export * from './src/directives/switch'; /** @@ -58,5 +58,5 @@ export * from './src/directives/switch'; * */ export const coreDirectives:List = CONST_EXPR([ - For, NgIf, NonBindable, Switch, SwitchWhen, SwitchDefault + For, NgIf, NgNonBindable, Switch, SwitchWhen, SwitchDefault ]); diff --git a/modules/angular2/src/directives/non_bindable.js b/modules/angular2/src/directives/ng_non_bindable.js similarity index 77% rename from modules/angular2/src/directives/non_bindable.js rename to modules/angular2/src/directives/ng_non_bindable.js index 680dc4b57b..5610ad8d27 100644 --- a/modules/angular2/src/directives/non_bindable.js +++ b/modules/angular2/src/directives/ng_non_bindable.js @@ -1,7 +1,7 @@ import {Directive} from 'angular2/src/core/annotations_impl/annotations'; /** - * The `NonBindable` directive tells Angular not to compile or bind the contents of the current + * The `NgNonBindable` directive tells Angular not to compile or bind the contents of the current * DOM element. This is useful if the element contains what appears to be Angular directives and * bindings but which should be ignored by Angular. This could be the case if you have a site that * displays snippets of code, for instance. @@ -16,8 +16,8 @@ import {Directive} from 'angular2/src/core/annotations_impl/annotations'; * @exportedAs angular2/directives */ @Directive({ - selector: '[non-bindable]', + selector: '[ng-non-bindable]', compileChildren: false }) -export class NonBindable { +export class NgNonBindable { } diff --git a/modules/angular2/test/directives/non_bindable_spec.js b/modules/angular2/test/directives/non_bindable_spec.js index 42199d5a89..1aca46c716 100644 --- a/modules/angular2/test/directives/non_bindable_spec.js +++ b/modules/angular2/test/directives/non_bindable_spec.js @@ -17,14 +17,14 @@ import {View} from 'angular2/src/core/annotations_impl/view'; import {ElementRef} from 'angular2/src/core/compiler/element_ref'; -import {NonBindable} from 'angular2/src/directives/non_bindable'; +import {NgNonBindable} from '../../src/directives/ng_non_bindable'; import {TestBed} from 'angular2/src/test_lib/test_bed'; export function main() { describe('non-bindable', () => { it('should not interpolate children', inject([TestBed, AsyncTestCompleter], (tb, async) => { - var template = '
{{text}}{{text}}
'; + var template = '
{{text}}{{text}}
'; tb.createView(TestComponent, {html: template}).then((view) => { view.detectChanges(); expect(DOM.getText(view.rootNodes[0])).toEqual('foo{{text}}'); @@ -33,7 +33,7 @@ export function main() { })); it('should ignore directives on child nodes', inject([TestBed, AsyncTestCompleter], (tb, async) => { - var template = '
{{text}}
'; + var template = '
{{text}}
'; tb.createView(TestComponent, {html: template}).then((view) => { view.detectChanges(); var span = DOM.querySelector(view.rootNodes[0], '#child'); @@ -43,7 +43,7 @@ export function main() { })); it('should trigger directives on the same node', inject([TestBed, AsyncTestCompleter], (tb, async) => { - var template = '
{{text}}
'; + var template = '
{{text}}
'; tb.createView(TestComponent, {html: template}).then((view) => { view.detectChanges(); var span = DOM.querySelector(view.rootNodes[0], '#child'); @@ -55,7 +55,7 @@ export function main() { } @Component({selector: 'test-cmp'}) -@View({directives: [NonBindable, TestDirective]}) +@View({directives: [NgNonBindable, TestDirective]}) class TestComponent { text: string; constructor() {