From 6dece68bb85d562db38f5da01a93068577ecd3b0 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 27 Apr 2015 09:26:55 -0700 Subject: [PATCH] refactor(core): rename ViewContainer to ViewContainerRef This also renames InternalAppViewContainer into AppViewContainer Related to #1477 Closes #1554 --- modules/angular2/core.js | 2 +- modules/angular2/docs/core/02_directives.md | 60 +++++++------- modules/angular2/docs/core/10_view.md | 78 +++++++++---------- .../src/core/annotations/annotations.js | 10 +-- .../src/core/compiler/element_injector.js | 8 +- modules/angular2/src/core/compiler/view.js | 6 +- ...iew_container.js => view_container_ref.js} | 2 +- .../src/core/compiler/view_manager.js | 4 +- .../src/core/compiler/view_manager_utils.js | 2 +- modules/angular2/src/directives/for.js | 6 +- modules/angular2/src/directives/if.js | 6 +- modules/angular2/src/directives/switch.js | 18 ++--- modules/angular2/src/render/api.js | 12 +-- .../src/render/dom/direct_dom_renderer.js | 10 +-- .../core/compiler/element_injector_spec.js | 8 +- .../test/core/compiler/integration_spec.js | 8 +- ...ner_spec.js => view_container_ref_spec.js} | 14 ++-- .../test/core/compiler/view_manager_spec.js | 12 +-- .../direct_dom_renderer_integration_spec.js | 6 +- .../test/render/dom/integration_testbed.js | 2 +- .../shadow_dom_emulation_integration_spec.js | 16 ++-- modules/benchmarks/src/tree/tree_benchmark.js | 2 +- 22 files changed, 145 insertions(+), 147 deletions(-) rename modules/angular2/src/core/compiler/{view_container.js => view_container_ref.js} (98%) rename modules/angular2/test/core/compiler/{view_container_spec.js => view_container_ref_spec.js} (78%) diff --git a/modules/angular2/core.js b/modules/angular2/core.js index 6a35b83f43..ef9a5665c5 100644 --- a/modules/angular2/core.js +++ b/modules/angular2/core.js @@ -23,7 +23,7 @@ export * from './src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy export * from './src/core/compiler/dynamic_component_loader'; export {ElementRef, ComponentRef} from './src/core/compiler/element_injector'; export * from './src/core/compiler/view'; -export * from './src/core/compiler/view_container'; +export * from './src/core/compiler/view_container_ref'; export * from './src/core/compiler/ng_element'; diff --git a/modules/angular2/docs/core/02_directives.md b/modules/angular2/docs/core/02_directives.md index c1eec301e4..7b57db38d7 100644 --- a/modules/angular2/docs/core/02_directives.md +++ b/modules/angular2/docs/core/02_directives.md @@ -6,7 +6,7 @@ Directives are the cornerstone of an Angular application. We use Directives to b Angular applications do not have a main method. Instead they have a root Component. Dependency Injection then assembles the directives into a working Angular application. -There are three different kinds of directives (described in more detail in later sections). +There are three different kinds of directives (described in more detail in later sections). 1. *Decorators*: can be placed on any DOM element and can be combined with other directives. 2. *Components*: Components have an encapsulated view and can configure injectors. @@ -16,7 +16,7 @@ There are three different kinds of directives (described in more detail in later ## CSS Selectors -Directives are instantiated whenever the CSS selector matches the DOM structure. +Directives are instantiated whenever the CSS selector matches the DOM structure. Angular supports these CSS selector constructs: * Element name: `name` @@ -29,7 +29,7 @@ Angular supports these CSS selector constructs: Angular does not support these (and any CSS selector which crosses element boundaries): * Descendant: `body div` -* Direct descendant: `body > div` +* Direct descendant: `body > div` * Adjacent: `div + table` * Sibling: `div ~ table` * Wildcard: `*` @@ -68,10 +68,10 @@ Here is a trivial example of a tooltip decorator. The directive will log a toolt @Decorator({ selector: '[tooltip]', // CSS Selector which triggers the decorator properties: { // List which properties need to be bound - text: 'tooltip' // - DOM element tooltip property should be + text: 'tooltip' // - DOM element tooltip property should be }, // mapped to the directive text property. hostListeners: { // List which events need to be mapped. - mouseover: 'show' // - Invoke the show() method every time + mouseover: 'show' // - Invoke the show() method every time } // the mouseover event is fired. }) class Form { // Directive controller class, instantiated @@ -121,14 +121,14 @@ Example of a component: templateUrl: 'pane.html' | - URL of template HTML }) | class Pane { | Component controller class - title:string; | - title property + title:string; | - title property open:boolean; - + constructor() { this.title = ''; this.open = true; } - + // Public API toggle() => this.open = !this.open; open() => this.open = true; @@ -165,12 +165,12 @@ Example of usage: ## Viewport -Viewport is a directive which can control instantiation of child views which are then inserted into the DOM. (Examples are `if` and `for`.) +Viewport is a directive which can control instantiation of child views which are then inserted into the DOM. (Examples are `if` and `for`.) * Viewports can only be placed on `