refactor(compiler): remove obsolete @View-related code (#9019)

This commit is contained in:
Pawel Kozlowski
2016-06-05 04:46:55 +02:00
committed by Miško Hevery
parent 057abefe50
commit 52ddc96c9f
2 changed files with 3 additions and 59 deletions

View File

@ -5,16 +5,6 @@ import {Component, ViewMetadata} from '@angular/core/src/metadata';
class SomeDir {}
class SomePipe {}
@Component({
selector: 'sample',
template: "some template",
directives: [SomeDir],
pipes: [SomePipe],
styles: ["some styles"]
})
class ComponentWithView {
}
@Component({
selector: 'sample',
template: "some template",
@ -25,14 +15,6 @@ class ComponentWithView {
class ComponentWithTemplate {
}
@Component({selector: 'sample', template: "some template"})
class ComponentWithViewTemplate {
}
@Component({selector: 'sample', templateUrl: "some template url", template: "some template"})
class ComponentWithViewTemplateUrl {
}
@Component({selector: 'sample'})
class ComponentWithoutView {
}
@ -57,13 +39,13 @@ export function main() {
}));
});
it('should throw when Component has no View decorator and no template is set', () => {
it('should throw when Component has neither template nor templateUrl set', () => {
expect(() => resolver.resolve(ComponentWithoutView))
.toThrowErrorWith(
"Component 'ComponentWithoutView' must have either 'template' or 'templateUrl' set");
});
it('should throw when simple class has no View decorator and no template is set', () => {
it('should throw when simple class has no component decorator', () => {
expect(() => resolver.resolve(SimpleClass))
.toThrowErrorWith("Could not compile 'SimpleClass' because it is not a component.");
});