Skip to content

Commit 0995db3

Browse files
committed
test($compile): add test for angular#15833
1 parent 9c34006 commit 0995db3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/ng/compileSpec.js

+23
Original file line numberDiff line numberDiff line change
@@ -5858,6 +5858,29 @@ describe('$compile', function() {
58585858
expect(componentScope.owRef).toEqual({name: 'lucas', item: {name: 'martin'}});
58595859
}));
58605860

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+
element = $compile('<form name="f" undi="[f.i]"><input name="i" ng-model="a"/></form>')($rootScope);
5879+
$rootScope.$apply();
5880+
expect(componentScope.undi).toBeDefined();
5881+
});
5882+
});
5883+
58615884

58625885
it('should not complain when the isolated scope changes', inject(function() {
58635886
compile('<div><span my-component ow-ref="{name: name}">');

0 commit comments

Comments
 (0)