refactor(core): remove …Metadata
for all decorators and use the decorator directly.
BREAKING CHANGE: - all `…Metadata` classes have been removed. Use the corresponding decorator as constructor or for `instanceof` checks instead. - Example: * Before: `new ComponentMetadata(…)` * After: `new Component(…)` - Note: `new Component(…)` worked before as well.
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
* Intended to be used in a build step.
|
||||
*/
|
||||
import * as compiler from '@angular/compiler';
|
||||
import {ComponentMetadata, NgModuleMetadata, ViewEncapsulation} from '@angular/core';
|
||||
import {Component, NgModule, ViewEncapsulation} from '@angular/core';
|
||||
import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
|
||||
import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
@ -62,9 +62,9 @@ export class CodeGenerator {
|
||||
const staticType = this.reflectorHost.findDeclaration(absSourcePath, symbol, absSourcePath);
|
||||
const annotations = this.staticReflector.annotations(staticType);
|
||||
annotations.forEach((annotation) => {
|
||||
if (annotation instanceof NgModuleMetadata) {
|
||||
if (annotation instanceof NgModule) {
|
||||
result.ngModules.push(staticType);
|
||||
} else if (annotation instanceof ComponentMetadata) {
|
||||
} else if (annotation instanceof Component) {
|
||||
result.components.push(staticType);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user