Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Unified Diff: third_party/pkg/angular/lib/directive/ng_include.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/angular/lib/directive/ng_include.dart
diff --git a/third_party/pkg/angular/lib/directive/ng_include.dart b/third_party/pkg/angular/lib/directive/ng_include.dart
index a824a125a25c22667dc0713dca3e5a18c6f47889..f0e35e0782a527e8396b098f0e4e15a2d056add7 100644
--- a/third_party/pkg/angular/lib/directive/ng_include.dart
+++ b/third_party/pkg/angular/lib/directive/ng_include.dart
@@ -5,57 +5,57 @@ part of angular.directive;
*
* A new child [Scope] is created for the included DOM subtree.
*
- * [NgInclude] provides only one small part of the power of
- * [Component].  Consider using directives and components instead as they
+ * [NgIncludeDirective] provides only one small part of the power of
+ * [NgComponent].  Consider using directives and components instead as they
* provide this feature as well as much more.
*
* Note: The browser's Same Origin Policy (<http://v.gd/5LE5CA>) and
* Cross-Origin Resource Sharing (CORS) policy (<http://v.gd/nXoY8y>) restrict
* whether the template is successfully loaded.  For example,
- * [NgInclude] won't work for cross-domain requests on all browsers and
+ * [NgIncludeDirective] won't work for cross-domain requests on all browsers and
* for `file://` access on some browsers.
*/
-@Decorator(
+@NgDirective(
selector: '[ng-include]',
map: const {'ng-include': '@url'})
-class NgInclude {
+class NgIncludeDirective {
final dom.Element element;
final Scope scope;
- final ViewCache viewCache;
+ final BlockCache blockCache;
final Injector injector;
final DirectiveMap directives;
- View _view;
- Scope _scope;
+ Block _previousBlock;
+ Scope _previousScope;
- NgInclude(this.element, this.scope, this.viewCache, this.injector, this.directives);
+ NgIncludeDirective(this.element, this.scope, this.blockCache, this.injector, this.directives);
_cleanUp() {
- if (_view == null) return;
+ if (_previousBlock == null) return;
- _view.nodes.forEach((node) => node.remove);
- _scope.destroy();
+ _previousBlock.remove();
+ _previousScope.destroy();
element.innerHtml = '';
- _view = null;
- _scope = null;
+ _previousBlock = null;
+ _previousScope = null;
}
- _updateContent(createView) {
+ _updateContent(createBlock) {
// create a new scope
- _scope = scope.createChild(new PrototypeMap(scope.context));
- _view = createView(injector.createChild([new Module()
- ..value(Scope, _scope)]));
+ _previousScope = scope.createChild(new PrototypeMap(scope.context));
+ _previousBlock = createBlock(injector.createChild([new Module()
+ ..value(Scope, _previousScope)]));
- _view.nodes.forEach((node) => element.append(node));
+ _previousBlock.elements.forEach((elm) => element.append(elm));
}
set url(value) {
_cleanUp();
if (value != null && value != '') {
- viewCache.fromUrl(value, directives).then(_updateContent);
+ blockCache.fromUrl(value, directives).then(_updateContent);
}
}
}
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_if.dart ('k') | third_party/pkg/angular/lib/directive/ng_model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698