angularjs - AngularUI separate files for modal controllers -
There are several models in my angular application, and I have AngularUI to provide a modular directive.
So far I have several main controllers, and all these apps The path in the JS file is in the form of.
$ routeProvider.when '/ dashboard', templateUrl: '/templates/dashboard/dashboard.html', Controller: 'DashboardController' $ routeProvider.when '/ dataset /: panel_id', templateUrl "/templates/dataset/datasetkhtml ', controller' DatasetController '$ RouteProviderkwhen' / batches /: panel_id ', templateUrl:' /templates/design/design.html ', controller'. PanelController '
This works fine an example of
Then I call a function that a model created, and ConfigureModalCtrl Is the controller. I was initially in the lower part of the Calling Controller file, and it worked fine.
$ scope.invokeConfigureModal = (assay_id) - & gt; $ Scope.assay_id = assay_id $ scope.primer3 = $ scope.getPrimer (assay_id) modalInstance = $ modal.open (templateUrl: '/templates/configure_modal/configure_modal.html' controller: ConfigureModalCtrl windowClass: 'configure-dialog "Resolution: Primer3 : - & gt; $ scope.primer3) modalInstance.result.then ((primer 3) - & gt; $ scope.primer3 = primer3 return), - & gt; Return
Now I have moved the modal instance controller in its own file, but can not find it in the calling function.
angular.module ('assaypipelineEp'). Controller "Configure Modal Translocation", ($ Scope, $ modalInstance, Primer 3) - & gt; $ Scope.primer3 = Primer 3 ['Data'] $ scope.ok = - & gt; $ ModalInstance.close $ scope.primer3 Return $ scope.cancel = - & gt; $ ModalInstance.dismiss "Cancel" ServerAirHardHeader = - & gt; Warning ("There was a server error, please reload the page and try again.")
error message
Error: Unknown Provider: ConfigureModelCoopprovider & lt; - Configurable ModalCital
is a similar type of question but does not solve my problem
So how can I solve this problem, and this other (non-modal Example) Why do not the controllers? Is it because they have been named in the routes?
Any suggestions on coding style are also welcome ... Thanks for reading this.
Comments
Post a Comment