ruby on rails - Error when registering an AngularJS controller dynamically in a separate file -


So I'm trying to present AngularJS to an already existing ROR environment.

This is a relatively heavy and robust web app, I thought the best way to go about it is to write a controller for each section of your 'file (for coffee, records) And will load it with a view from the $ waypair, dynamically doing something like this (except for irrelevant parts):

  app.config ["$ routeProvider", "$ controller" , ($ Route provider, $ controller provider) - & gt; App.registerCtrl = $ controllerProvider.register $ routeProvider. When ("url1", templateUrl: "url1.html .haml" controller: "url1Ctrl"). When loading ("url2" templateUrl: "url2.html.haml" Controller: "main JS file in the left file (and the above snippet in it), and each named controller file in the appropriate view:" / homepage "  

(which is dynamic, obviously). In each of them, I try to load the relevant controller using the following:

  @ Url1ctrl = app.registerCtrl 'url1Ctrl', ['$ scope', ....., ($ radius, ....) -> # some logic  

is the problem , "Uncaught TypeE" Rror: there is no function undefined. "I thought I was doing something wrong but it seems that I am a legitimate citizen there.

(Same opinion)

(instead of using ".controller" instead of?), Also read a set of similar questions:

>

(The same, but the controller files always Loaded, sluggish-loaded dynamically no ...)

(looks like more complexity?)

(do it Try areas of

What part of Koyonr I would like some input on'm misinterpreted.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -