Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b0f6afc

Browse files
committed
test($compile): add test for #15833
1 parent 2931a6d commit b0f6afc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/ng/compileSpec.js

+24
Original file line numberDiff line numberDiff line change
@@ -5944,6 +5944,30 @@ describe('$compile', function() {
59445944
}));
59455945

59465946

5947+
// https://github.com/angular/angular.js/issues/15833
5948+
it('should work with ng-model inputs', function() {
5949+
var componentScope;
5950+
5951+
module(function($compileProvider) {
5952+
$compileProvider.directive('undi', function() {
5953+
return {
5954+
restrict: 'A',
5955+
scope: {
5956+
undi: '<'
5957+
},
5958+
link: function($scope) { componentScope = $scope; }
5959+
};
5960+
});
5961+
});
5962+
5963+
inject(function($compile, $rootScope) {
5964+
element = $compile('<form name="f" undi="[f.i]"><input name="i" ng-model="a"/></form>')($rootScope);
5965+
$rootScope.$apply();
5966+
expect(componentScope.undi).toBeDefined();
5967+
});
5968+
});
5969+
5970+
59475971
it('should not complain when the isolated scope changes', inject(function() {
59485972
compile('<div><span my-component ow-ref="{name: name}">');
59495973

0 commit comments

Comments
 (0)