I have a angular SPA setup with 3 pages which are injected
*app.config(function($routeProvider) {*
* $routeProvider*
* // route for the home page*
* .when('/', {*
* templateUrl : 'pages/home.html',*
* controller : 'mainController'*
* })*
* // route for the about page*
* .when('/smartmeter', {*
* templateUrl : 'pages/meter.html',*
* controller : 'aboutController'*
* })*
* // route for the contact page*
* .when('/contact', {*
* templateUrl : 'pages/contact.html',*
* controller : 'contactController'*
* });*
* });*
In this same javascript the data is loaded and conitinuesly refreshed from
the server and injected in the several pages when needed (home.html,
meter.html and contact.html)
So even if I go the page meter.html all the data is refreshed also for the
other pages.
What i want is that the needed javascript is executed only when i go to
that certain page
so if i go to meter.html the data for this page will be fetched and
refreshed.
I cant inject the javascript and also cutting up the javascript and put it
on top of for example meter.html does not work.
it is based on the example, only difference is that i get the data from a
server http://plnkr.co/edit/dd8Nk9PDFotCQu4yrnDg?p=info
is there a solution?
--
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.