The actual resume of compile is when you call $compile, not when you link 
the result. You have to make sure you don’t resume until you added the 
attribute you want in the link function.

.directive('foo', function($compile) {
  return {
    restrict: 'A',
    priority: 9999,
    terminal: true,
    link: function(scope, el, attr) {
        attr.$set('ngModel', 'formData.' + scope[attr.foo]);
        // Resume the compilation phase after setting ngModel
        $compile(el, null, 9999)(scope);
    }
  };
});

-- 
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/groups/opt_out.

Reply via email to