New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directive templateUrl gives to No Controller Error #1903

jasonkuhrt opened this Issue Jan 28, 2013 · 14 comments


None yet

jasonkuhrt commented Jan 28, 2013

I am currently running into this exact issue

I created an plunker

that appears to show everything ...working. However I am unable to reproduce this success in my application. Both versions of angularjs match (1.0.3) so my only guess is that templateUrl: 'foo.html' in plunker is not an accurate mechanism of my local server app's templateUrl: '../../parts/map/map.html'.

To be clear, in my app, if I inline the template templateUrl: '../../parts/map/map.html' then everything is totally fine.

Inline template: Works

Screen Shot 2013-01-28 at 4 57 09 PM

External template: Error

Screen Shot 2013-01-28 at 4 55 09 PM

One thing that struck me is the order of logging is different in the Error version: map controller fn comes AFTER map-marker link fn whereas when its working map controller fn comes BEFORE map-marker link fn.

Did I find a bug in angular or my head?


This comment has been minimized.

ymauray commented Jan 30, 2013

I have the exact same problem. So it's probably not in your head :).

I'll try to make a Plunker later.

Edit : here's my plunker

You can see the error in the JavaScript console :

Error: No controller: demoTable
    at Error (<anonymous>)
    at getControllers (
    at nodeLinkFn (
    at delayedNodeLinkFn (
    at compositeLinkFn (
    at publicLinkFn (
    at new ngDirective.controller (
    at invoke (

If you uncomment line 23 of app.js and comment line 22, then there's no more error and everything works fine.


This comment has been minimized.


ItsLeeOwen commented Apr 1, 2013

Did you guys uncover any fixes, or workarounds for this issue? I am not sure why this is occurring in a new app I've just started as well.


This comment has been minimized.

anthony-o commented May 15, 2013

I've got the same problem using Angular 1.1.4... when using 'templateUrl' + controller, I've got a "No Controller", and when I use only the 'template', then the problem disappear...


This comment has been minimized.

ehelms commented Jun 5, 2013

I have also recently stumbled across this exact same issue. Use of templateUrl in directives that use 'require: '^'' break with 'no controller' error.


This comment has been minimized.

rohitmanusis commented Jun 6, 2013

Experiencing the same issue. Use of require '^' with templateUrl in directive gives 'no controller' error.


This comment has been minimized.

cdmckay commented Jun 21, 2013

Also experiencing the same issue, even with 1.1.5. The solution I've used so far is to make the parent controller into a template instead of a templateUrl.


This comment has been minimized.

darkpicnic commented Jul 9, 2013

So have we confirmed it's the combo of termplateUrl and require?


This comment has been minimized.

lc-nyovchev commented Jul 15, 2013

Exact same problem on 1.0.7


This comment has been minimized.

sja commented Aug 5, 2013

@darkpicnic I've got the same problem on 1.1.5 with template and require: '^...


This comment has been minimized.

ivarni commented Aug 9, 2013

I am having this exact problem. I was just refactoring some directives from using template and inline HTML to using templateUrl and this exact issue popped up. I am also using require.
Observed in 1.0.5 and 1.0.7


This comment has been minimized.


lrlopez commented Aug 9, 2013

There is a commit (5c56011) that was merged some hours ago. It should have fixed this. If it does, it'd be nice to close the issue...


This comment has been minimized.


btford commented Dec 20, 2013

Looks like it's working in 1.2.5 now:

If this is still a problem and you can provide a broken demo on 1.2.x, I'll gladly re-open this for discussion. Thanks!

@btford btford closed this Dec 20, 2013


This comment has been minimized.

SimplGy commented Dec 31, 2013

Could there be a regression on this for v1.2.7-build.2036+sha.e415e91? I'm trying to confirm using the plnkr but I don't think I can CDN to that build.

When I use require: '^directive' and templateUrl, I got the same error described here.


This comment has been minimized.


caitp commented Jan 1, 2014

I'm having trouble reproducing this, but I think the most likely thing that would cause this (in a modern build) is manually $compiling nodes without making use of the cloneConnectFn, which would cause the HTML compiler to not find the parent directives. here's an example, tested in a few builds (snapshot, 1.2.5 and 1.0.3), as far as I can tell this is always working as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment