Created
May 28, 2014 08:19
-
-
Save Ulv/6a5d92a614442d16976d to your computer and use it in GitHub Desktop.
angularjs, coffeescript: app ng-update-hidden directive (use hidden form field with angular model)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Usage: <input type="hidden" ng-model="elementid" ng-update-hidden /> | |
| .directive 'ngUpdateHidden', -> | |
| (scope, el, attr) -> | |
| model = attr["ngModel"] | |
| scope.$watch model, (nv) -> | |
| el.val nv | |
| return | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment