Having some difficulty creating a popup directive where I want to retrieve a template from the server, insert it into a popup div, and display it on the screen. Additionally, I would like these popups to have their own controllers. Unfortunately, it is not working as expected. Here is the code snippet:
I attempted to include the directive HTML within the controller's HTML like this:
<div ng-controller="HeadCtrl">
<a href="" popup="login.html">Login</a>
</div>
However, this did not yield any changes and resulted in an error:
Error: [$injector:unpr] Unknown provider: popupProvider <- popup
http://errors.angularjs.org/1.2.2/$injector/unpr?p0=popupProvider%20%3C-%20popup
minErr/<@http://fabrykakartek.dev/bower_components/angular/angular.js:78
createInjector/providerCache.$injector<@http://fabrykakartek.dev/bower_components
/angular/angular.js:3468 getService@http://fabrykakartek.dev/bower_components/angular
/angular.js:3595
As a novice in AngularJS, I might be missing something. Any help or explanation regarding this issue would be greatly appreciated.
EDIT: Removing ng-controller from the template actually displays the popup. Therefore, the question remains - why does ng-controller disrupt this code? It appears there may be an issue with creating the scope for the controller. Any insights or suggestions are welcome.