You would then use the ng-view directive. Due to its primal
directive-paradigm you actually dont need any scripts other than
application.js and your client would only need to mark the container where
your plugin should end up in. There are 4 ways in which you can utilize
angular to mark that container: element name, attribute, class and comment.
To me it looks like what you want is not ngRoute, as ngRoute manages the
routes of a whole app, but rather write directive whose controller in turn
could make use of some services (these are basically your model in angular).
It is handy on its own, but would make much more sense if the plugin is
embedded in an angular SPA, because framework overhead & stuff.
If you really insist on hosting application.js on your own site, you also
have to deal with CORS.
I recommend you take a look at some angular directive tutorial, your use
case probably requires an isolated scope, so dive deep & have fun!
Am Donnerstag, 5. Februar 2015 00:59:15 UTC+1 schrieb Geoff Swartz:
>
> I'm brand new to angular but from what I've seen so far it appears that
> your application needs to run on an html page so for another part of the
> app to run, you navigate as you would in any other type of web site. In my
> case, I'm looking to develop an app with multiple views/templates which
> will be run on a site similar to a jquery plugin. Below is some pseudo
> code to illustrate
>
> Main Web Page on customersite.com
>
> <html><head>
> <script src="mysite.com/application.js"></script>
> <script>
> window.onload = function(){ app = new myapp(); app.init('content');}
> </script>
> <body>
> <div id="content"></div>
> </body>
> </html>
>
>
> application.js on mysite.com
>
> var myapp = function(){
> this.init = function(div){
> load my app in the div passed in
> }
> }
>
>
> So, the intention is to leave the page on customersite.com with minimal
> script and html and all the logic along with the templates are handled by
> the application.js file on my site. Is this possible to do with angular?
> Thanks.
>
--
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.