Skip to content

Commit

Permalink
fix(core): Fix typo in bundle error message, relax isNgModule check (f…
Browse files Browse the repository at this point in the history
…ixes #155) (#159)
  • Loading branch information
JamesHenry authored Oct 16, 2016
1 parent 5564c97 commit 52fa571
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/core/di/provider_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ function _hasTemplate( annotation: any ): boolean {
return isPresent( annotation.template || annotation.templateUrl );
}

export function isService(annotation: any): annotation is InjectableMetadata {
export function isService( annotation: any ): annotation is InjectableMetadata {
return annotation instanceof InjectableMetadata;
}
export function isPipe(annotation: any): annotation is PipeMetadata {
return isString(annotation.name) && annotation instanceof PipeMetadata;
export function isPipe( annotation: any ): annotation is PipeMetadata {
return isString( annotation.name ) && annotation instanceof PipeMetadata;
}
export function isInjectMetadata( injectMeta: any ): injectMeta is InjectMetadata {
return injectMeta instanceof InjectMetadata;
}

export function isNgModule( annotation: any ): annotation is NgModuleMetadata {
return isPresent( annotation.declarations ) && annotation instanceof NgModuleMetadata
return annotation instanceof NgModuleMetadata
}
2 changes: 1 addition & 1 deletion src/core/util/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function bundle( NgModuleClass: Type, otherProviders: any[] = [], existin
const annotations = reflector.annotations( NgModuleClass );
const ngModuleAnnotation: NgModuleMetadata = annotations[ 0 ];
if (!isNgModule(ngModuleAnnotation)) {
throw new Error(`bundle() requires an @NgModule as it's first argument`)
throw new Error(`bundle() requires a decorated NgModule as its first argument`)
}
const { declarations = [], providers = [], imports = [] }={} = ngModuleAnnotation;

Expand Down

0 comments on commit 52fa571

Please sign in to comment.