This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.6k
ng-model doesn't work with custom directive if the directive replaces content #4603
Comments
@bratc Are you using the template or templateUrl property to specify the HTML? |
@FedericoElles I'm using templateUrl because in my case it's inconvenient to use template (far too big) |
Happened to me as well. |
Is there a workaround for this? I need to use templateUrl. |
There is no code in your post. Can you post the code or even better a plunker? |
It works again with version 1.2.3 and later |
@petebacondarwin This can be closed. Just pinging you because you seem to be currently closing some stuff. |
Thanks @Narretz . Please do ping me for issues that can be closed :-) Makes my day. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've faced with following problem. I created directive that replace existing element with new one and used it like this:
When I ran this code I received an error:
Error: [$compile:ctreq] Controller 'ngModel', required by directive 'myDirective', can't be found!
http://errors.angularjs.org/1.2.0-rc.3/$compile/ctreq?p0=ngModel&p1=myDirective
at http://localhost:63343/demo-app/lib/angular/angular.js:78:12
at getControllers (http://localhost:63343/demo-app/lib/angular/angular.js:5288:19)
at http://localhost:63343/demo-app/lib/angular/angular.js:5294:24
at Array.forEach (native)
at forEach (http://localhost:63343/demo-app/lib/angular/angular.js:213:11)
at getControllers (http://localhost:63343/demo-app/lib/angular/angular.js:5293:11)
at nodeLinkFn (http://localhost:63343/demo-app/lib/angular/angular.js:5436:35)
at http://localhost:63343/demo-app/lib/angular/angular.js:5589:13
at http://localhost:63343/demo-app/lib/angular/angular.js:6672:11
at deferred.promise.then.wrappedCallback (http://localhost:63343/demo-app/lib/angular/angular.js:9769:81)
This directive works perfectly well with 1.2rc2 but doesn't work with 1.2rc3
The text was updated successfully, but these errors were encountered: