Skip to content

Commit dea6a45

Browse files
committed
cleanup(core): making @view optional
Closes angular#4566
1 parent d386896 commit dea6a45

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

modules/angular2/test/core/linker/integration_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ export function main() {
17011701
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
17021702
tcb.overrideView(MyComp, new ViewMetadata({
17031703
template: '<component-with-template></component-with-template>',
1704-
directives: [ComponentWithTempalte]
1704+
directives: [ComponentWithTemplate]
17051705
}))
17061706
.createAsync(MyComp)
17071707
.then((rootTC) => {
@@ -2270,7 +2270,7 @@ class DirectiveThrowingAnError {
22702270
selector: 'component-with-template',
22712271
directives: [NgFor], template: `No View Decorator: <div *ng-for="#item of items">{{item}}</div>`
22722272
})
2273-
class ComponentWithTempalte {
2273+
class ComponentWithTemplate {
22742274
items = [1, 2, 3];
22752275
}
22762276

modules/angular2/test/core/linker/view_resolver_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class ComponentWithTemplate {
2626
class ComponentWithViewTemplate {
2727
}
2828

29-
@Component({selector: 'sample'})
30-
class ComponentWithoutView {
31-
}
32-
3329
@Component({selector: 'sample', templateUrl: "some template url"})
3430
@View({template: "some template"})
3531
class ComponentWithViewTemplateUrl {
3632
}
3733

34+
@Component({selector: 'sample'})
35+
class ComponentWithoutView {
36+
}
37+
3838
@View({template: "some template"})
3939
class ClassWithView {
4040
}

modules/examples/src/hello_world/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {bootstrap} from 'angular2/bootstrap';
2-
import {ElementRef, Component, Directive, View, Injectable} from 'angular2/core';
2+
import {ElementRef, Component, Directive, Injectable} from 'angular2/core';
33
import {Renderer} from 'angular2/render';
44

55
export function main() {

modules_dart/transform/lib/src/transform/template_compiler/compile_data_creator.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ class _DirectiveDependenciesVisitor extends Object
195195
/// reflector.
196196
@override
197197
Object visitInstanceCreationExpression(InstanceCreationExpression node) {
198-
// if (_isViewAnnotation(node)) {
199198
if (_isViewAnnotation(node) || _isComponentAnnotation(node)) {
200199
compileData = new NormalizedComponentWithViewDirectives(
201200
null, <CompileDirectiveMetadata>[]);

0 commit comments

Comments
 (0)