Set up model options.

This commit is contained in:
Paulo Reis 2016-06-24 11:02:29 +01:00
parent e51bdaaaaf
commit a587d5ddba
2 changed files with 10 additions and 2 deletions

View file

@ -11,9 +11,14 @@ script(type='text/ng-template', id='supportModalTemplate')
label label
| #{translate("subject")} | #{translate("subject")}
.form-group .form-group
input.field.text.medium.span8.form-control(ng-model="form.subject", maxlength='255', tabindex='1', onkeyup='') input.field.text.medium.span8.form-control(
ng-model="form.subject",
ng-model-options="{ updateOn: 'default blur', debounce: {'default': 350, 'blur': 0} }"
maxlength='255',
tabindex='1',
onkeyup='')
.contact-suggestions .contact-suggestions
p.contact-suggestion-label Have you checked our knowledge base? p.contact-suggestion-label Have you checked our knowledge base? {{ form.subject }}
ul.contact-suggestion-list ul.contact-suggestion-list
li: a.contact-suggestion-list-item li: a.contact-suggestion-list-item
span Item 1 - subsection lorem span Item 1 - subsection lorem

View file

@ -36,6 +36,9 @@ define [
$scope.sent = true $scope.sent = true
$scope.$apply() $scope.$apply()
$scope.$watch 'form.subject', (newVal, oldVal) ->
console.log newVal, oldVal
$scope.close = () -> $scope.close = () ->
$modalInstance.close() $modalInstance.close()