@ -5,7 +5,6 @@ import {Injectable} from 'angular2/src/core/di';
|
||||
import {Type, isBlank, stringify} from 'angular2/src/facade/lang';
|
||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
import {CompiledHostTemplate} from 'angular2/src/core/linker/template_commands';
|
||||
|
||||
@ -31,7 +30,7 @@ export class Compiler_ extends Compiler {
|
||||
|
||||
compileInHost(componentType: Type): Promise<ProtoViewRef> {
|
||||
var metadatas = reflector.annotations(componentType);
|
||||
var compiledHostTemplate = ListWrapper.find(metadatas, _isCompiledHostTemplate);
|
||||
var compiledHostTemplate = metadatas.find(_isCompiledHostTemplate);
|
||||
|
||||
if (isBlank(compiledHostTemplate)) {
|
||||
throw new BaseException(
|
||||
|
@ -35,7 +35,7 @@ export class DirectiveResolver {
|
||||
resolve(type: Type): DirectiveMetadata {
|
||||
var typeMetadata = reflector.annotations(resolveForwardRef(type));
|
||||
if (isPresent(typeMetadata)) {
|
||||
var metadata = ListWrapper.find(typeMetadata, _isDirectiveMetadata);
|
||||
var metadata = typeMetadata.find(_isDirectiveMetadata);
|
||||
if (isPresent(metadata)) {
|
||||
var propertyMetadata = reflector.propMetadata(type);
|
||||
return this._mergeWithPropertyMetadata(metadata, propertyMetadata);
|
||||
|
@ -120,14 +120,14 @@ export class DirectiveDependency extends Dependency {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
static _attributeName(properties): string {
|
||||
var p = <AttributeMetadata>ListWrapper.find(properties, (p) => p instanceof AttributeMetadata);
|
||||
static _attributeName(properties: any[]): string {
|
||||
var p = <AttributeMetadata>properties.find(p => p instanceof AttributeMetadata);
|
||||
return isPresent(p) ? p.attributeName : null;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
static _query(properties): QueryMetadata {
|
||||
return <QueryMetadata>ListWrapper.find(properties, (p) => p instanceof QueryMetadata);
|
||||
static _query(properties: any[]): QueryMetadata {
|
||||
return <QueryMetadata>properties.find(p => p instanceof QueryMetadata);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import {resolveForwardRef, Injectable} from 'angular2/src/core/di';
|
||||
import {Type, isPresent, stringify} from 'angular2/src/facade/lang';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {BaseException} from 'angular2/src/facade/exceptions';
|
||||
import {PipeMetadata} from 'angular2/src/core/metadata';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
@ -24,7 +23,7 @@ export class PipeResolver {
|
||||
resolve(type: Type): PipeMetadata {
|
||||
var metas = reflector.annotations(resolveForwardRef(type));
|
||||
if (isPresent(metas)) {
|
||||
var annotation = ListWrapper.find(metas, _isPipeMetadata);
|
||||
var annotation = metas.find(_isPipeMetadata);
|
||||
if (isPresent(annotation)) {
|
||||
return annotation;
|
||||
}
|
||||
|
Reference in New Issue
Block a user