Feedback on http://docs.angularjs.org/#!/api/angular.widget.ng:view

51 views
Skip to first unread message

Christop...@waters.com

unread,
Mar 28, 2012, 11:15:12 AM3/28/12
to ang...@googlegroups.com
Hi there,

I read
http://docs.angularjs.org/#!/api/angular.widget.ng:view and wanted to ask ....

What I'm trying to do load a partial, (plugin view) from my server using angular: $route.when(...) and ng:view. Now this works fine if I include the controller.js in the main index.html file. See attached file below:




I presume this work because the angular compiler finds the controller.js on document load.

What I really what to do is have my plugin view completely separate from the container view, so I tried moving the <script src".../controller.js"> tag into my plugin html file. See attached file below:



What I have just notice is that the controller.js file is not being requested from the server!

So my question is should I be able to do this using angular routes and the ng:view

Hope I've included enough details for you to understand what I'm trying to do.

Cheers
Chris

===========================================================
The information in this email is confidential, and is intended solely for the addressee(s). 
Access to this email by anyone else is unauthorized and therefore prohibited.  If you are 
not the intended recipient you are notified that disclosing, copying, distributing or taking 
any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
===========================================================

index.html
index.html

Vojta Jína

unread,
Mar 29, 2012, 4:26:03 AM3/29/12
to ang...@googlegroups.com
Controllers don't have to be present during bootstrap, so you can lazy
load them.

Are you saying you are putting the JS code into the partial that you
are loading ? If so, than you need jQuery, because by default the
content is not executed, jqLite is not clever enough to evaluate the
JS code inlined in the html...

Is that what you are asking for ?

V.

> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to ang...@googlegroups.com.
> To unsubscribe from this group, send email to
> angular+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/angular?hl=en.

Reply all
Reply to author
Forward
0 new messages