Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

directive templateUrl gives to No Controller Error #1903

@jasonkuhrt

Description

@jasonkuhrt

I am currently running into this exact issue

http://stackoverflow.com/questions/12006326/angularjs-templateurl-defers-construction-of-controller-dependent-code-breaks

I created an plunker

http://plnkr.co/edit/mTMQHEILCRkc8uwBMuy8?p=preview

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions