@@ -4,17 +4,18 @@ import {Type, isPresent, BaseException, stringify, isBlank} from 'angular2/src/f
4
4
import { View } from 'angular2/src/core/annotations_impl/view' ;
5
5
import { TemplateResolver } from 'angular2/src/core/compiler/template_resolver' ;
6
6
7
+
7
8
export class MockTemplateResolver extends TemplateResolver {
8
- _templates : Map < Type , View > ;
9
+ _views : Map < Type , View > ;
9
10
_inlineTemplates : Map < Type , string > ;
10
- _templateCache : Map < Type , View > ;
11
+ _viewCache : Map < Type , View > ;
11
12
_directiveOverrides : Map < Type , Map < Type , Type > > ;
12
13
13
14
constructor ( ) {
14
15
super ( ) ;
15
- this . _templates = MapWrapper . create ( ) ;
16
+ this . _views = MapWrapper . create ( ) ;
16
17
this . _inlineTemplates = MapWrapper . create ( ) ;
17
- this . _templateCache = MapWrapper . create ( ) ;
18
+ this . _viewCache = MapWrapper . create ( ) ;
18
19
this . _directiveOverrides = MapWrapper . create ( ) ;
19
20
}
20
21
@@ -26,7 +27,7 @@ export class MockTemplateResolver extends TemplateResolver {
26
27
*/
27
28
setView ( component : Type , view : View ) : void {
28
29
this . _checkOverrideable ( component ) ;
29
- MapWrapper . set ( this . _templates , component , view ) ;
30
+ MapWrapper . set ( this . _views , component , view ) ;
30
31
}
31
32
32
33
/**
@@ -47,7 +48,7 @@ export class MockTemplateResolver extends TemplateResolver {
47
48
* @param {Type } from
48
49
* @param {Type } to
49
50
*/
50
- overrideTemplateDirective ( component : Type , from : Type , to : Type ) : void {
51
+ overrideViewDirective ( component : Type , from : Type , to : Type ) : void {
51
52
this . _checkOverrideable ( component ) ;
52
53
53
54
var overrides = MapWrapper . get ( this . _directiveOverrides , component ) ;
@@ -62,20 +63,20 @@ export class MockTemplateResolver extends TemplateResolver {
62
63
63
64
/**
64
65
* Returns the {@link View} for a component:
65
- * - Set the {@link View} to the overridden template when it exists or fallback to the default
66
+ * - Set the {@link View} to the overridden view when it exists or fallback to the default
66
67
* `TemplateResolver`,
67
68
* see `setView`.
68
- * - Override the directives, see `overrideTemplateDirective `.
69
+ * - Override the directives, see `overrideViewDirective `.
69
70
* - Override the @View definition, see `setInlineTemplate`.
70
71
*
71
72
* @param component
72
73
* @returns {ViewDefinition }
73
74
*/
74
75
resolve ( component : Type ) : View {
75
- var view = MapWrapper . get ( this . _templateCache , component ) ;
76
+ var view = MapWrapper . get ( this . _viewCache , component ) ;
76
77
if ( isPresent ( view ) ) return view ;
77
78
78
- view = MapWrapper . get ( this . _templates , component ) ;
79
+ view = MapWrapper . get ( this . _views , component ) ;
79
80
if ( isBlank ( view ) ) {
80
81
view = super . resolve ( component ) ;
81
82
}
@@ -106,7 +107,7 @@ export class MockTemplateResolver extends TemplateResolver {
106
107
view = new View ( { template : inlineTemplate , templateUrl : null , directives : view . directives } ) ;
107
108
}
108
109
109
- MapWrapper . set ( this . _templateCache , component , view ) ;
110
+ MapWrapper . set ( this . _viewCache , component , view ) ;
110
111
return view ;
111
112
}
112
113
@@ -119,7 +120,7 @@ export class MockTemplateResolver extends TemplateResolver {
119
120
* @param {Type } component
120
121
*/
121
122
_checkOverrideable ( component : Type ) : void {
122
- var cached = MapWrapper . get ( this . _templateCache , component ) ;
123
+ var cached = MapWrapper . get ( this . _viewCache , component ) ;
123
124
124
125
if ( isPresent ( cached ) ) {
125
126
throw new BaseException (
0 commit comments