Embed URL


SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Set model value to given form value in html

View ng_initial.js
1 2 3 4 5 6 7 8
app.directive 'ngInitial', ->
restrict: 'A'
controller: ['$scope', '$element', '$attrs', '$parse', ($scope, $element, $attrs, $parse) ->
val = $attrs.sbInitial || $attrs.value || $element.text()
getter = $parse($attrs.ngModel)
setter = getter.assign
setter($scope, val)

sbInitial in line 4 shouldn't be ngInitial?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.