chore: rename non-bindable to ng-non-bindable

This commit is contained in:
Misko Hevery 2015-05-11 16:00:53 -07:00
parent d310a9c0b4
commit 78d3f62b6a
3 changed files with 11 additions and 11 deletions

View File

@ -8,13 +8,13 @@
import {CONST_EXPR} from './src/facade/lang'; import {CONST_EXPR} from './src/facade/lang';
import {For} from './src/directives/for'; import {For} from './src/directives/for';
import {NgIf} from './src/directives/ng_if'; 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'; import {Switch, SwitchWhen, SwitchDefault} from './src/directives/switch';
export * from './src/directives/class'; export * from './src/directives/class';
export * from './src/directives/for'; export * from './src/directives/for';
export * from './src/directives/ng_if'; export * from './src/directives/ng_if';
export * from './src/directives/non_bindable'; export * from './src/directives/ng_non_bindable';
export * from './src/directives/switch'; export * from './src/directives/switch';
/** /**
@ -58,5 +58,5 @@ export * from './src/directives/switch';
* *
*/ */
export const coreDirectives:List = CONST_EXPR([ export const coreDirectives:List = CONST_EXPR([
For, NgIf, NonBindable, Switch, SwitchWhen, SwitchDefault For, NgIf, NgNonBindable, Switch, SwitchWhen, SwitchDefault
]); ]);

View File

@ -1,7 +1,7 @@
import {Directive} from 'angular2/src/core/annotations_impl/annotations'; 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 * 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 * 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. * displays snippets of code, for instance.
@ -16,8 +16,8 @@ import {Directive} from 'angular2/src/core/annotations_impl/annotations';
* @exportedAs angular2/directives * @exportedAs angular2/directives
*/ */
@Directive({ @Directive({
selector: '[non-bindable]', selector: '[ng-non-bindable]',
compileChildren: false compileChildren: false
}) })
export class NonBindable { export class NgNonBindable {
} }

View File

@ -17,14 +17,14 @@ import {View} from 'angular2/src/core/annotations_impl/view';
import {ElementRef} from 'angular2/src/core/compiler/element_ref'; 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'; import {TestBed} from 'angular2/src/test_lib/test_bed';
export function main() { export function main() {
describe('non-bindable', () => { describe('non-bindable', () => {
it('should not interpolate children', inject([TestBed, AsyncTestCompleter], (tb, async) => { it('should not interpolate children', inject([TestBed, AsyncTestCompleter], (tb, async) => {
var template = '<div>{{text}}<span non-bindable>{{text}}</span></div>'; var template = '<div>{{text}}<span ng-non-bindable>{{text}}</span></div>';
tb.createView(TestComponent, {html: template}).then((view) => { tb.createView(TestComponent, {html: template}).then((view) => {
view.detectChanges(); view.detectChanges();
expect(DOM.getText(view.rootNodes[0])).toEqual('foo{{text}}'); 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) => { it('should ignore directives on child nodes', inject([TestBed, AsyncTestCompleter], (tb, async) => {
var template = '<div non-bindable><span id=child test-dec>{{text}}</span></div>'; var template = '<div ng-non-bindable><span id=child test-dec>{{text}}</span></div>';
tb.createView(TestComponent, {html: template}).then((view) => { tb.createView(TestComponent, {html: template}).then((view) => {
view.detectChanges(); view.detectChanges();
var span = DOM.querySelector(view.rootNodes[0], '#child'); 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) => { it('should trigger directives on the same node', inject([TestBed, AsyncTestCompleter], (tb, async) => {
var template = '<div><span id=child non-bindable test-dec>{{text}}</span></div>'; var template = '<div><span id=child ng-non-bindable test-dec>{{text}}</span></div>';
tb.createView(TestComponent, {html: template}).then((view) => { tb.createView(TestComponent, {html: template}).then((view) => {
view.detectChanges(); view.detectChanges();
var span = DOM.querySelector(view.rootNodes[0], '#child'); var span = DOM.querySelector(view.rootNodes[0], '#child');
@ -55,7 +55,7 @@ export function main() {
} }
@Component({selector: 'test-cmp'}) @Component({selector: 'test-cmp'})
@View({directives: [NonBindable, TestDirective]}) @View({directives: [NgNonBindable, TestDirective]})
class TestComponent { class TestComponent {
text: string; text: string;
constructor() { constructor() {