Hi Igor, I'm facing exactly same problem as Robert had but the solution you suggested is no longer available in v1.2.14. Do you have any other approach to handle jQuery loading Angular template?
Thanks, Terry On Friday, August 19, 2011 6:05:52 PM UTC-4, Igor Minar wrote: > > awesome :) > > On Fri, Aug 19, 2011 at 4:26 AM, Robert B. Weeks <[email protected] > <javascript:>> wrote: > >> Hello Igor! >> >> > Hi! >> > >> > is the including page an angular app or is only the included page an >> angular app? >> >> Only the included page. These are resources loaded in from OSGi bundles >> into a legacy app, which is injected with the angular libraries. >> >> > the issue is that ng:autobind depends on DOMContentLoaded or >> document.load events and both of these fired on the including page way >> before the jquery call to load angular page. >> >> Ah - ok. That makes sense. I was trying to track down the sequence of the >> jquery load. >> >> > if only the included app is an angular app then all you need is >> removing ng:autobind and compile/bootstrap your app manually: >> > >> > $('#settings_container').load(interfaceComponentURL, function() { >> > angular.compile($('#settings_container'))(); >> > }); >> > >> > if this doesn't work because angular is undefined, then jquery didn't >> evaluate your javascript on requested page and that would be sad. But I >> believe that that should not be the case. >> >> That would be sad! :) >> >> >> > let us know if this worked... >> >> From preliminary work this morning - this did work. Thanks *so* much for >> the fast reply. This saved me more head-banging today! :) >> >> *Love* angular. Have been touting it all over the place lately. Great >> work. >> >> >> > >> > /i >> > >> > >> > On Thu, Aug 18, 2011 at 7:01 PM, Robert B. Weeks <[email protected] >> <javascript:>> wrote: >> > Hello - >> > >> > I have this situation where in certain places in our app, a resource >> will be loaded via the jquery load statement - say something like: >> > >> > >> > {page information } >> > <script... >> > $('#settings_container').load(interfaceComponentURL); >> > </script> >> > {page information} >> > >> > where the 'interfaceComponentURL' is an external page that has the >> script loading call to angular, and the supporting scripts and view. >> > >> > When I load this page in normally - the binding and all works correctly >> - but when loading in as a "partial" into an existing page using the format >> above, the binding/bootloading doesn't seem to be happening. >> > >> > The content of the 'interfaceComponentURL' contains text like >> <snippets>: >> > >> > >> > <script type="text/javascript"> >> > //<![CDATA[ >> > >> > function InterfaceSettingsForm($invalidWidgets) { >> > this.$invalidWidgets = $invalidWidgets; >> > .... >> > } >> > //]]> >> > </script> >> > >> > <div ng:controller="InterfaceSettingsForm"> >> > ... Form information here >> > </div> >> > <script type="text/javascript" >> src="/osgi/myResources/js/angular/angular.min.js" ng:autobind></script> >> > >> > (I have also tried loading the angular lib before the above script) >> > >> > The page in question does have the namespace defined in the <html tag. >> > >> > Should I be binding/initializing somehow differently here? >> > >> > Thanks for any help. >> > >> >> -- >> Robert B. Weeks >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "angular" group. >> To post to this group, send email to [email protected] >> <javascript:>. >> To unsubscribe from this group, send email to >> [email protected] <javascript:>. >> For more options, visit this group at >> http://groups.google.com/group/angular?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
