The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

New in Angular 1.3: ng-model-options getters and setters

New in Angular 1.3: ng-model-options getters and setters

3:34
With ngModelOptions in Angular 1.3 you can turn your model into a getter/setter function to have greater control over your model.
Watch this lesson now
Avatar
egghead.io

With ngModelOptions in Angular 1.3 you can turn your model into a getter/setter function to have greater control over your model.

Avatar
Derek

In order to use getterSetter I found myself using arguments.length to allow users to clear values. I've also got updateOn: 'blur' in my model options in my use case.

vm.inputValue = function(val) {
    return arguments.length ? (_val = val) : _val;
  }
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?