This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +27
-0
lines changed
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -5858,6 +5858,33 @@ describe('$compile', function() {
5858
5858
expect ( componentScope . owRef ) . toEqual ( { name : 'lucas' , item : { name : 'martin' } } ) ;
5859
5859
} ) ) ;
5860
5860
5861
+ //https://github.com/angular/angular.js/issues/15833
5862
+ it ( 'should work with ng-model inputs' , function ( ) {
5863
+ var componentScope ;
5864
+
5865
+ module ( function ( $compileProvider ) {
5866
+ $compileProvider . directive ( 'undi' , function ( ) {
5867
+ return {
5868
+ restrict : 'A' ,
5869
+ scope : {
5870
+ undi : '<'
5871
+ } ,
5872
+ link : function ( $scope ) { componentScope = $scope ; }
5873
+ } ;
5874
+ } ) ;
5875
+ } ) ;
5876
+
5877
+ inject ( function ( $compile , $rootScope ) {
5878
+ $compile ( '<form name="f" undi="[f.i]"><input name="i" ng-model="a"/></form>' ) ( $rootScope ) ;
5879
+ $rootScope . $apply ( ) ;
5880
+ expect ( $rootScope . f . i ) . toBeDefined ( ) ;
5881
+ expect ( componentScope . undi ) . toBeDefined ( ) ;
5882
+ //TODO: the `.not` should be removed in 1.7 due to
5883
+ //https://github.com/angular/angular.js/commit/fd4f0111188b62773b99ab6eab38b4d2b5d8d727
5884
+ expect ( componentScope . undi ) . not . toBe ( $rootScope . f . i ) ;
5885
+ } ) ;
5886
+ } ) ;
5887
+
5861
5888
5862
5889
it ( 'should not complain when the isolated scope changes' , inject ( function ( ) {
5863
5890
compile ( '<div><span my-component ow-ref="{name: name}">' ) ;
You can’t perform that action at this time.
0 commit comments