u can use ngModel.$render() after ngModel.$setViewValue(title + ++i); On Friday, December 14, 2012 at 5:08:49 PM UTC+3:30, Alex Figueiredo wrote: > > Can someone tell me what I'm doing wrong here? > > angular.module('customControl', []) > .directive('rangePicker', function () { > > return { > restrict : 'E', > require : '?ngModel', > replace : true, > transclude : true, > template : '<div class="range" ng-transclude></div>', > > link : function (ng, elem, attrs, ngModel) { > > var title = 'Test'; > var i = 0; > > elem.bind('click', function () { > console.log('click'); > ngModel.$setViewValue(title + ++i); > }); > > } > } > }); > > > <div ng-app="customControl"> > <range-picker ng-model="modelo"> > Filtrar por período > </range-picker> > {{modelo}} > </div> > > The problem is that my var "modelo" is never updated. > > http://jsfiddle.net/AlexFigueiredoo/tHXpN/ >
-- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/7d4adaef-2a6a-497b-9982-f7f7f8e4ed14%40googlegroups.com.