Hi Norman,

I think You are forgetting the curly braces on ng-model-options,

<input type="text" ng-model="ctrl.firstname"
ng-model-options="{getterSetter: true}">



On Tue, Dec 1, 2015 at 9:15 AM, Norman Braun <[email protected]>
wrote:

> Hi,
>
> i do some tutorials at the moment and wonder why it is not working. The
> code should display the firstname max in text and in input field. But it is
> only shown in text. Maybe somebody can help? Thx
>
> HTML
>
> <section ng-controller="userCtrl as ctrl">
>     <p ng-bind="ctrl.firstname()"></p>
>     <input type="text" ng-model="ctrl.firstname" 
> ng-model-options="getterSetter: true">
> </section>
>
>
> JS
>
>
> // ... //
>
>
> var userController = function () {
>     this._firstname = "Max"
> }
> var pUserController = userController.prototype;
> pUserController.firstname = function (value) {
>     if (angular.isDefined(value)) this._firstname = value;
>     return this._firstname;
> }
>
> var app = angular.module('app',[]);
> app.controller('userCtrl', userController);
>
>
> // ... //
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to