@@ -57,10 +57,6 @@ describe('ngProp*', function() {
57
57
it ( 'should work with different prefixes' , inject ( function ( $rootScope , $compile ) {
58
58
$rootScope . name = 'Misko' ;
59
59
var element = $compile ( '<span ng:prop:test="name" ng-Prop-test2="name" ng_Prop_test3="name"></span>' ) ( $rootScope ) ;
60
- expect ( element . prop ( 'test' ) ) . toBeUndefined ( ) ;
61
- expect ( element . prop ( 'test2' ) ) . toBeUndefined ( ) ;
62
- expect ( element . prop ( 'test3' ) ) . toBeUndefined ( ) ;
63
- $rootScope . $digest ( ) ;
64
60
expect ( element . prop ( 'test' ) ) . toBe ( 'Misko' ) ;
65
61
expect ( element . prop ( 'test2' ) ) . toBe ( 'Misko' ) ;
66
62
expect ( element . prop ( 'test3' ) ) . toBe ( 'Misko' ) ;
@@ -77,12 +73,6 @@ describe('ngProp*', function() {
77
73
$rootScope . name = 'Misko' ;
78
74
var element = $compile ( '<span data-ng-prop-test2="name" x-ng-prop-test3="name" data-ng:prop-test4="name" ' +
79
75
'x_ng-prop-test5="name" data:ng-prop-test6="name"></span>' ) ( $rootScope ) ;
80
- expect ( element . prop ( 'test2' ) ) . toBeUndefined ( ) ;
81
- expect ( element . prop ( 'test3' ) ) . toBeUndefined ( ) ;
82
- expect ( element . prop ( 'test4' ) ) . toBeUndefined ( ) ;
83
- expect ( element . prop ( 'test5' ) ) . toBeUndefined ( ) ;
84
- expect ( element . prop ( 'test6' ) ) . toBeUndefined ( ) ;
85
- $rootScope . $digest ( ) ;
86
76
expect ( element . prop ( 'test2' ) ) . toBe ( 'Misko' ) ;
87
77
expect ( element . prop ( 'test3' ) ) . toBe ( 'Misko' ) ;
88
78
expect ( element . prop ( 'test4' ) ) . toBe ( 'Misko' ) ;
@@ -117,7 +107,6 @@ describe('ngProp*', function() {
117
107
} ) ;
118
108
inject ( function ( $compile , $rootScope ) {
119
109
$compile ( '<div attr-exposer ng-prop-title="12" ng-prop-super-title="34" ng-prop-my-camel_title="56">' ) ( $rootScope ) ;
120
- $rootScope . $digest ( ) ;
121
110
122
111
expect ( attrs . title ) . toBeUndefined ( ) ;
123
112
expect ( attrs . $attr . title ) . toBeUndefined ( ) ;
@@ -147,7 +136,6 @@ describe('ngProp*', function() {
147
136
} ) ;
148
137
inject ( function ( $compile , $rootScope ) {
149
138
$compile ( '<div attr-exposer ng-prop-title="42" ng-attr-title="foo" title="bar">' ) ( $rootScope ) ;
150
- $rootScope . $apply ( ) ;
151
139
expect ( attrs . title ) . toBe ( 'foo' ) ;
152
140
expect ( attrs . $attr . title ) . toBe ( 'title' ) ;
153
141
expect ( attrs . $attr . ngPropTitle ) . toBe ( 'ng-prop-title' ) ;
@@ -166,7 +154,7 @@ describe('ngProp*', function() {
166
154
'$compile' , 'nodomevents' , 'Property bindings for HTML DOM event properties are disallowed' ) ;
167
155
} ) ) ;
168
156
169
- it ( 'should process property bindings at $watch time ' , function ( ) {
157
+ it ( 'should process property bindings in pre-linking phase at priority 100 ' , function ( ) {
170
158
module ( provideLog ) ;
171
159
module ( function ( $compileProvider ) {
172
160
$compileProvider . directive ( 'propLog' , function ( log , $rootScope ) {
@@ -205,11 +193,10 @@ describe('ngProp*', function() {
205
193
} ) ;
206
194
inject ( function ( $rootScope , $compile , log ) {
207
195
var element = $compile ( '<div prop-log-high-priority prop-log ng-prop-my_name="name"></div>' ) ( $rootScope ) ;
208
- log ( 'postCompile=' + element . prop ( 'myName' ) ) ;
209
196
$rootScope . name = 'angular' ;
210
197
$rootScope . $apply ( ) ;
211
198
log ( 'digest=' + element . prop ( 'myName' ) ) ;
212
- expect ( log ) . toEqual ( 'compile=undefined; preLinkP101=undefined; preLinkP0=undefined ; postLink=undefined; postCompile=undefined ; digest=angular' ) ;
199
+ expect ( log ) . toEqual ( 'compile=undefined; preLinkP101=undefined; preLinkP0=pre101 ; postLink=pre101 ; digest=angular' ) ;
213
200
} ) ;
214
201
} ) ;
215
202
@@ -730,7 +717,7 @@ describe('ngProp*', function() {
730
717
module ( function ( $provide ) {
731
718
$provide . decorator ( '$sce' , function ( $delegate ) {
732
719
$delegate . trustAsHtml = function ( html ) { return new MySafeHtml ( html ) ; } ;
733
- $delegate . getTrusted = function ( type , mySafeHtml ) { return mySafeHtml . val ; } ;
720
+ $delegate . getTrusted = function ( type , mySafeHtml ) { return mySafeHtml && mySafeHtml . val ; } ;
734
721
$delegate . valueOf = function ( v ) { return v instanceof MySafeHtml ? v . val : v ; } ;
735
722
return $delegate ;
736
723
} ) ;
0 commit comments