2016-06-08 19:38:52 -04:00
import { StaticReflector , StaticReflectorHost , StaticSymbol } from '@angular/compiler-cli/src/static_reflector' ;
import { animate , group , keyframes , sequence , state , style , transition , trigger } from '@angular/core' ;
import { beforeEach , ddescribe , describe , expect , iit , it } from '@angular/core/testing/testing_internal' ;
2016-04-28 20:50:03 -04:00
import { ListWrapper } from '@angular/facade/src/collection' ;
2016-06-08 19:38:52 -04:00
import { isBlank } from '@angular/facade/src/lang' ;
2016-05-31 12:15:17 -04:00
2016-04-30 15:27:37 -04:00
describe ( 'StaticReflector' , ( ) = > {
2016-05-02 12:38:46 -04:00
let noContext = new StaticSymbol ( '' , '' ) ;
2016-04-30 15:27:37 -04:00
let host : StaticReflectorHost ;
let reflector : StaticReflector ;
2016-02-18 13:53:21 -05:00
2016-04-30 15:27:37 -04:00
beforeEach ( ( ) = > {
host = new MockReflectorHost ( ) ;
reflector = new StaticReflector ( host ) ;
} ) ;
2016-03-24 13:03:10 -04:00
2016-04-30 15:27:37 -04:00
function simplify ( context : StaticSymbol , value : any ) {
return reflector . simplify ( context , value ) ;
}
2016-02-18 13:53:21 -05:00
2016-04-30 15:27:37 -04:00
it ( 'should get annotations for NgFor' , ( ) = > {
let NgFor = host . findDeclaration ( 'angular2/src/common/directives/ng_for' , 'NgFor' ) ;
let annotations = reflector . annotations ( NgFor ) ;
expect ( annotations . length ) . toEqual ( 1 ) ;
let annotation = annotations [ 0 ] ;
expect ( annotation . selector ) . toEqual ( '[ngFor][ngForOf]' ) ;
expect ( annotation . inputs ) . toEqual ( [ 'ngForTrackBy' , 'ngForOf' , 'ngForTemplate' ] ) ;
2016-03-24 13:03:10 -04:00
} ) ;
2016-04-30 15:27:37 -04:00
it ( 'should get constructor for NgFor' , ( ) = > {
let NgFor = host . findDeclaration ( 'angular2/src/common/directives/ng_for' , 'NgFor' ) ;
let ViewContainerRef =
host . findDeclaration ( 'angular2/src/core/linker/view_container_ref' , 'ViewContainerRef' ) ;
let TemplateRef = host . findDeclaration ( 'angular2/src/core/linker/template_ref' , 'TemplateRef' ) ;
let IterableDiffers = host . findDeclaration (
'angular2/src/core/change_detection/differs/iterable_differs' , 'IterableDiffers' ) ;
let ChangeDetectorRef = host . findDeclaration (
'angular2/src/core/change_detection/change_detector_ref' , 'ChangeDetectorRef' ) ;
let parameters = reflector . parameters ( NgFor ) ;
2016-06-08 19:38:52 -04:00
expect ( parameters ) . toEqual ( [
[ ViewContainerRef ] , [ TemplateRef ] , [ IterableDiffers ] , [ ChangeDetectorRef ]
] ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should get annotations for HeroDetailComponent' , ( ) = > {
let HeroDetailComponent =
host . findDeclaration ( 'src/app/hero-detail.component' , 'HeroDetailComponent' ) ;
let annotations = reflector . annotations ( HeroDetailComponent ) ;
expect ( annotations . length ) . toEqual ( 1 ) ;
let annotation = annotations [ 0 ] ;
expect ( annotation . selector ) . toEqual ( 'my-hero-detail' ) ;
2016-06-08 19:38:52 -04:00
expect ( annotation . directives ) . toEqual ( [ [ host . findDeclaration (
'angular2/src/common/directives/ng_for' , 'NgFor' ) ] ] ) ;
expect ( annotation . animations ) . toEqual ( [ trigger ( 'myAnimation' , [
state ( 'state1' , style ( { 'background' : 'white' } ) ) ,
transition (
'* => *' ,
sequence ( [ group ( [ animate (
'1s 0.5s' ,
keyframes ( [ style ( { 'background' : 'blue' } ) , style ( { 'background' : 'red' } ) ] ) ) ] ) ] ) )
] ) ] ) ;
2016-04-30 15:27:37 -04:00
} ) ;
2016-06-02 19:40:38 -04:00
it ( 'should throw and exception for unsupported metadata versions' , ( ) = > {
let e = host . findDeclaration ( 'src/version-error' , 'e' ) ;
2016-06-08 19:38:52 -04:00
expect ( ( ) = > reflector . annotations ( e ) )
. toThrow ( new Error (
'Metadata version mismatch for module /tmp/src/version-error.d.ts, found version 100, expected 1' ) ) ;
2016-06-02 19:40:38 -04:00
} ) ;
2016-04-30 15:27:37 -04:00
it ( 'should get and empty annotation list for an unknown class' , ( ) = > {
let UnknownClass = host . findDeclaration ( 'src/app/app.component' , 'UnknownClass' ) ;
let annotations = reflector . annotations ( UnknownClass ) ;
expect ( annotations ) . toEqual ( [ ] ) ;
} ) ;
it ( 'should get propMetadata for HeroDetailComponent' , ( ) = > {
let HeroDetailComponent =
host . findDeclaration ( 'src/app/hero-detail.component' , 'HeroDetailComponent' ) ;
let props = reflector . propMetadata ( HeroDetailComponent ) ;
expect ( props [ 'hero' ] ) . toBeTruthy ( ) ;
} ) ;
it ( 'should get an empty object from propMetadata for an unknown class' , ( ) = > {
let UnknownClass = host . findDeclaration ( 'src/app/app.component' , 'UnknownClass' ) ;
let properties = reflector . propMetadata ( UnknownClass ) ;
expect ( properties ) . toEqual ( { } ) ;
} ) ;
it ( 'should get empty parameters list for an unknown class ' , ( ) = > {
let UnknownClass = host . findDeclaration ( 'src/app/app.component' , 'UnknownClass' ) ;
let parameters = reflector . parameters ( UnknownClass ) ;
expect ( parameters ) . toEqual ( [ ] ) ;
} ) ;
2016-06-03 18:43:09 -04:00
it ( 'should provide context for errors reported by the collector' , ( ) = > {
let SomeClass = host . findDeclaration ( 'src/error-reporting' , 'SomeClass' ) ;
2016-06-08 19:38:52 -04:00
expect ( ( ) = > reflector . annotations ( SomeClass ) )
. toThrow ( new Error (
'Error encountered resolving symbol values statically. A reasonable error message (position 12:33 in the original .ts file), resolving symbol ErrorSym in /tmp/src/error-references.d.ts, resolving symbol Link2 in /tmp/src/error-references.d.ts, resolving symbol Link1 in /tmp/src/error-references.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts, resolving symbol SomeClass in /tmp/src/error-reporting.d.ts' ) ) ;
2016-06-03 18:43:09 -04:00
} ) ;
2016-04-30 15:27:37 -04:00
it ( 'should simplify primitive into itself' , ( ) = > {
expect ( simplify ( noContext , 1 ) ) . toBe ( 1 ) ;
expect ( simplify ( noContext , true ) ) . toBe ( true ) ;
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , 'some value' ) ) . toBe ( 'some value' ) ;
2016-04-30 15:27:37 -04:00
} ) ;
2016-06-08 19:38:52 -04:00
it ( 'should simplify an array into a copy of the array' , ( ) = > {
expect ( simplify ( noContext , [ 1 , 2 , 3 ] ) ) . toEqual ( [ 1 , 2 , 3 ] ) ;
} ) ;
2016-04-30 15:27:37 -04:00
it ( 'should simplify an object to a copy of the object' , ( ) = > {
let expr = { a : 1 , b : 2 , c : 3 } ;
expect ( simplify ( noContext , expr ) ) . toEqual ( expr ) ;
} ) ;
it ( 'should simplify &&' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&&' , left : true , right : true } ) ) )
. toBe ( true ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&&' , left : true , right : false } ) ) )
. toBe ( false ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&&' , left : false , right : true } ) ) )
. toBe ( false ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&&' , left : false , right : false } ) ) )
. toBe ( false ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify ||' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '||' , left : true , right : true } ) ) )
. toBe ( true ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '||' , left : true , right : false } ) ) )
. toBe ( true ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '||' , left : false , right : true } ) ) )
. toBe ( true ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '||' , left : false , right : false } ) ) )
. toBe ( false ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify &' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&' , left : 0x22 , right : 0x0F } ) ) )
. toBe ( 0x22 & 0x0F ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '&' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 & 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify |' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '|' , left : 0x22 , right : 0x0F } ) ) )
. toBe ( 0x22 | 0x0F ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '|' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 | 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify ^' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '|' , left : 0x22 , right : 0x0F } ) ) )
. toBe ( 0x22 | 0x0F ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '|' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 | 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify ==' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '==' , left : 0x22 , right : 0x22 } ) ) )
. toBe ( 0x22 == 0x22 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '==' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 == 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify !=' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '!=' , left : 0x22 , right : 0x22 } ) ) )
. toBe ( 0x22 != 0x22 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '!=' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 != 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify ===' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '===' , left : 0x22 , right : 0x22 } ) ) )
. toBe ( 0x22 === 0x22 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '===' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 === 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify !==' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '!==' , left : 0x22 , right : 0x22 } ) ) )
. toBe ( 0x22 !== 0x22 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '!==' , left : 0x22 , right : 0xF0 } ) ) )
. toBe ( 0x22 !== 0xF0 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify >' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>' , left : 1 , right : 1 } ) ) )
. toBe ( 1 > 1 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>' , left : 1 , right : 0 } ) ) )
. toBe ( 1 > 0 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>' , left : 0 , right : 1 } ) ) )
. toBe ( 0 > 1 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify >=' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>=' , left : 1 , right : 1 } ) ) )
. toBe ( 1 >= 1 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>=' , left : 1 , right : 0 } ) ) )
. toBe ( 1 >= 0 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>=' , left : 0 , right : 1 } ) ) )
. toBe ( 0 >= 1 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify <=' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<=' , left : 1 , right : 1 } ) ) )
. toBe ( 1 <= 1 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<=' , left : 1 , right : 0 } ) ) )
. toBe ( 1 <= 0 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<=' , left : 0 , right : 1 } ) ) )
. toBe ( 0 <= 1 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify <' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<' , left : 1 , right : 1 } ) ) )
. toBe ( 1 < 1 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<' , left : 1 , right : 0 } ) ) )
. toBe ( 1 < 0 ) ;
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<' , left : 0 , right : 1 } ) ) )
. toBe ( 0 < 1 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify <<' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '<<' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 << 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify >>' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '>>' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 >> 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify +' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '+' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 + 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify -' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '-' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 - 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify *' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '*' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 * 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify /' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '/' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 / 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify %' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'binop' , operator : '%' , left : 0x55 , right : 2 } ) ) )
. toBe ( 0x55 % 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify prefix -' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'pre' , operator : '-' , operand : 2 } ) ) ) . toBe ( - 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify prefix ~' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'pre' , operator : '~' , operand : 2 } ) ) ) . toBe ( ~ 2 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify prefix !' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'pre' , operator : '!' , operand : true } ) ) ) . toBe ( ! true ) ;
expect ( simplify ( noContext , ( { __symbolic : 'pre' , operator : '!' , operand : false } ) ) ) . toBe ( ! false ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify an array index' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify ( noContext , ( { __symbolic : 'index' , expression : [ 1 , 2 , 3 ] , index : 2 } ) ) ) . toBe ( 3 ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify an object index' , ( ) = > {
2016-06-08 19:38:52 -04:00
let expr = { __symbolic : 'select' , expression : { a : 1 , b : 2 , c : 3 } , member : 'b' } ;
2016-04-30 15:27:37 -04:00
expect ( simplify ( noContext , expr ) ) . toBe ( 2 ) ;
} ) ;
it ( 'should simplify a module reference' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify (
new StaticSymbol ( '/src/cases' , '' ) ,
( { __symbolic : 'reference' , module : './extern' , name : 's' } ) ) )
. toEqual ( 's' ) ;
2016-04-30 15:27:37 -04:00
} ) ;
it ( 'should simplify a non existing reference as a static symbol' , ( ) = > {
2016-06-08 19:38:52 -04:00
expect ( simplify (
new StaticSymbol ( '/src/cases' , '' ) ,
( { __symbolic : 'reference' , module : './extern' , name : 'nonExisting' } ) ) )
2016-05-02 12:38:46 -04:00
. toEqual ( host . getStaticSymbol ( '/src/extern.d.ts' , 'nonExisting' ) ) ;
2016-04-30 15:27:37 -04:00
} ) ;
} ) ;
2016-03-24 13:03:10 -04:00
class MockReflectorHost implements StaticReflectorHost {
2016-04-29 00:54:02 -04:00
private staticTypeCache = new Map < string , StaticSymbol > ( ) ;
2016-05-01 14:22:39 -04:00
angularImportLocations() {
return {
coreDecorators : 'angular2/src/core/metadata' ,
diDecorators : 'angular2/src/core/di/decorators' ,
diMetadata : 'angular2/src/core/di/metadata' ,
2016-05-31 12:15:17 -04:00
animationMetadata : 'angular2/src/core/animation/metadata' ,
2016-05-01 14:22:39 -04:00
provider : 'angular2/src/core/di/provider'
} ;
}
2016-05-02 12:38:46 -04:00
getStaticSymbol ( declarationFile : string , name : string ) : StaticSymbol {
2016-04-29 00:54:02 -04:00
var cacheKey = ` ${ declarationFile } : ${ name } ` ;
var result = this . staticTypeCache . get ( cacheKey ) ;
if ( isBlank ( result ) ) {
2016-05-02 12:38:46 -04:00
result = new StaticSymbol ( declarationFile , name ) ;
2016-04-29 00:54:02 -04:00
this . staticTypeCache . set ( cacheKey , result ) ;
}
return result ;
2016-02-18 13:53:21 -05:00
}
2016-04-29 00:54:02 -04:00
// In tests, assume that symbols are not re-exported
2016-04-29 00:58:51 -04:00
findDeclaration ( module Path : string , symbolName : string , containingFile? : string ) : StaticSymbol {
2016-04-26 00:29:06 -04:00
function splitPath ( path : string ) : string [ ] { return path . split ( /\/|\\/g ) ; }
function resolvePath ( pathParts : string [ ] ) : string {
2016-04-30 15:27:37 -04:00
let result : string [ ] = [ ] ;
2016-04-26 00:29:06 -04:00
ListWrapper . forEachWithIndex ( pathParts , ( part , index ) = > {
switch ( part ) {
case '' :
case '.' :
if ( index > 0 ) return ;
break ;
case '..' :
if ( index > 0 && result . length != 0 ) result . pop ( ) ;
return ;
}
result . push ( part ) ;
} ) ;
return result . join ( '/' ) ;
}
function pathTo ( from : string , to : string ) : string {
let result = to ;
if ( to . startsWith ( '.' ) ) {
let fromParts = splitPath ( from ) ;
fromParts . pop ( ) ; // remove the file name.
let toParts = splitPath ( to ) ;
result = resolvePath ( fromParts . concat ( toParts ) ) ;
}
return result ;
}
2016-04-29 00:54:02 -04:00
if ( module Path.indexOf ( '.' ) === 0 ) {
2016-05-02 12:38:46 -04:00
return this . getStaticSymbol ( pathTo ( containingFile , module Path ) + '.d.ts' , symbolName ) ;
2016-04-26 00:29:06 -04:00
}
2016-05-02 12:38:46 -04:00
return this . getStaticSymbol ( '/tmp/' + module Path + '.d.ts' , symbolName ) ;
2016-04-26 00:29:06 -04:00
}
2016-03-24 13:03:10 -04:00
getMetadataFor ( module Id : string ) : any {
2016-04-30 15:27:37 -04:00
let data : { [ key : string ] : any } = {
2016-06-08 13:44:04 -04:00
'/tmp/angular2/src/common/forms-deprecated/directives.d.ts' : [ {
2016-06-08 19:38:52 -04:00
'__symbolic' : 'module' ,
'version' : 1 ,
'metadata' : {
'FORM_DIRECTIVES' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'name' : 'NgFor' ,
'module' : 'angular2/src/common/directives/ng_for'
2016-02-18 13:53:21 -05:00
}
2016-04-30 15:27:37 -04:00
]
}
2016-06-02 19:40:38 -04:00
} ] ,
2016-04-30 15:27:37 -04:00
'/tmp/angular2/src/common/directives/ng_for.d.ts' : {
2016-06-08 19:38:52 -04:00
'__symbolic' : 'module' ,
'version' : 1 ,
'metadata' : {
'NgFor' : {
'__symbolic' : 'class' ,
'decorators' : [
2016-02-18 13:53:21 -05:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'Directive' ,
'module' : '../../core/metadata'
2016-04-30 15:27:37 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'selector' : '[ngFor][ngForOf]' ,
'inputs' : [ 'ngForTrackBy' , 'ngForOf' , 'ngForTemplate' ]
2016-04-30 15:27:37 -04:00
}
]
}
] ,
2016-06-08 19:38:52 -04:00
'members' : {
'__ctor__' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'constructor' ,
'parameters' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'module' : '../../core/linker/view_container_ref' ,
'name' : 'ViewContainerRef'
2016-04-30 15:27:37 -04:00
} ,
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'module' : '../../core/linker/template_ref' ,
'name' : 'TemplateRef'
2016-04-30 15:27:37 -04:00
} ,
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'module' : '../../core/change_detection/differs/iterable_differs' ,
'name' : 'IterableDiffers'
2016-04-30 15:27:37 -04:00
} ,
2016-02-18 13:53:21 -05:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'module' : '../../core/change_detection/change_detector_ref' ,
'name' : 'ChangeDetectorRef'
2016-02-18 13:53:21 -05:00
}
2016-04-30 15:27:37 -04:00
]
}
]
}
}
}
} ,
'/tmp/angular2/src/core/linker/view_container_ref.d.ts' :
2016-06-08 19:38:52 -04:00
{ version : 1 , 'metadata' : { 'ViewContainerRef' : { '__symbolic' : 'class' } } } ,
2016-04-30 15:27:37 -04:00
'/tmp/angular2/src/core/linker/template_ref.d.ts' :
2016-06-08 19:38:52 -04:00
{ version : 1 , 'module' : './template_ref' , 'metadata' : { 'TemplateRef' : { '__symbolic' : 'class' } } } ,
2016-04-30 15:27:37 -04:00
'/tmp/angular2/src/core/change_detection/differs/iterable_differs.d.ts' :
2016-06-08 19:38:52 -04:00
{ version : 1 , 'metadata' : { 'IterableDiffers' : { '__symbolic' : 'class' } } } ,
2016-04-30 15:27:37 -04:00
'/tmp/angular2/src/core/change_detection/change_detector_ref.d.ts' :
2016-06-08 19:38:52 -04:00
{ version : 1 , 'metadata' : { 'ChangeDetectorRef' : { '__symbolic' : 'class' } } } ,
2016-04-30 15:27:37 -04:00
'/tmp/src/app/hero-detail.component.d.ts' : {
2016-06-08 19:38:52 -04:00
'__symbolic' : 'module' ,
'version' : 1 ,
'metadata' : {
'HeroDetailComponent' : {
'__symbolic' : 'class' ,
'decorators' : [
2016-04-12 12:40:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'Component' ,
'module' : 'angular2/src/core/metadata'
2016-04-30 15:27:37 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'selector' : 'my-hero-detail' ,
'template' :
'\n <div *ngIf="hero">\n <h2>{{hero.name}} details!</h2>\n <div><label>id: </label>{{hero.id}}</div>\n <div>\n <label>name: </label>\n <input [(ngModel)]="hero.name" placeholder="name"/>\n </div>\n </div>\n' ,
'directives' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'reference' ,
'name' : 'FORM_DIRECTIVES' ,
'module' : 'angular2/src/common/forms-deprecated/directives'
2016-04-30 15:27:37 -04:00
}
2016-05-31 12:15:17 -04:00
] ,
2016-06-08 19:38:52 -04:00
'animations' : [ {
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'trigger' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
'myAnimation' ,
[ { '__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'state' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
'state1' ,
{ '__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'style' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
{ 'background' : 'white' }
2016-05-31 12:15:17 -04:00
]
}
]
} , {
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'transition' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
'* => *' ,
2016-05-31 12:15:17 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'sequence' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [ [ { '__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'group' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [ [ {
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'animate' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [
'1s 0.5s' ,
{ '__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'keyframes' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [ [ { '__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'style' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [ { 'background' : 'blue' } ]
2016-05-31 12:15:17 -04:00
} , {
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'style' ,
'module' : 'angular2/src/core/animation/metadata'
2016-05-31 12:15:17 -04:00
} ,
2016-06-08 19:38:52 -04:00
'arguments' : [ { 'background' : 'red' } ]
2016-05-31 12:15:17 -04:00
} ] ]
}
]
} ] ]
} ] ]
}
]
}
]
2016-04-30 15:27:37 -04:00
]
2016-05-31 12:15:17 -04:00
} ]
} ]
} ] ,
2016-06-08 19:38:52 -04:00
'members' : {
'hero' : [
2016-04-30 15:27:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'property' ,
'decorators' : [
2016-04-12 12:40:37 -04:00
{
2016-06-08 19:38:52 -04:00
'__symbolic' : 'call' ,
'expression' : {
'__symbolic' : 'reference' ,
'name' : 'Input' ,
'module' : 'angular2/src/core/metadata'
2016-04-30 15:27:37 -04:00
}
2016-04-12 12:40:37 -04:00
}
2016-04-30 15:27:37 -04:00
]
}
]
}
}
}
} ,
2016-06-08 19:38:52 -04:00
'/src/extern.d.ts' : { '__symbolic' : 'module' , 'version' : 1 , metadata : { s : 's' } } ,
'/tmp/src/version-error.d.ts' : { '__symbolic' : 'module' , 'version' : 100 , metadata : { e : 's' } } ,
2016-06-03 18:43:09 -04:00
'/tmp/src/error-reporting.d.ts' : {
2016-06-08 19:38:52 -04:00
__symbolic : 'module' ,
2016-06-03 18:43:09 -04:00
version : 1 ,
metadata : {
SomeClass : {
2016-06-08 19:38:52 -04:00
__symbolic : 'class' ,
2016-06-03 18:43:09 -04:00
decorators : [
{
2016-06-08 19:38:52 -04:00
__symbolic : 'call' ,
2016-06-03 18:43:09 -04:00
expression : {
2016-06-08 19:38:52 -04:00
__symbolic : 'reference' ,
name : 'Component' ,
module : 'angular2/src/core/metadata'
2016-06-03 18:43:09 -04:00
} ,
arguments : [
{
directives : [
{
2016-06-08 19:38:52 -04:00
__symbolic : 'reference' ,
module : 'src/error-references' ,
name : 'Link1' ,
2016-06-03 18:43:09 -04:00
}
]
}
]
}
] ,
}
}
} ,
'/tmp/src/error-references.d.ts' : {
2016-06-08 19:38:52 -04:00
__symbolic : 'module' ,
2016-06-03 18:43:09 -04:00
version : 1 ,
metadata : {
Link1 : {
2016-06-08 19:38:52 -04:00
__symbolic : 'reference' ,
module : 'src/error-references' ,
name : 'Link2'
2016-06-03 18:43:09 -04:00
} ,
Link2 : {
2016-06-08 19:38:52 -04:00
__symbolic : 'reference' ,
module : 'src/error-references' ,
name : 'ErrorSym'
2016-06-03 18:43:09 -04:00
} ,
ErrorSym : {
2016-06-08 19:38:52 -04:00
__symbolic : 'error' ,
message : 'A reasonable error message' ,
2016-06-03 18:43:09 -04:00
line : 12 ,
character : 33
}
}
}
2016-04-30 15:27:37 -04:00
} ;
return data [ module Id ] ;
2016-03-24 13:03:10 -04:00
}
}