Thursday 15 April 2010

javascript - Sharing $scope data between angular js and non angular js -



javascript - Sharing $scope data between angular js and non angular js -

in angularjs, $scope.mydata contains info in controller. i'm using jsp (normal jsp page) out angularjs functionality,but want info in scope variable (mydata) contains in controller. how can retrieve info in scope variable in jsp page. can sugest this..

i think can create variable in top of app.js in angular stater project. create clear may sample code help base of operations on angular tabs starter project:

// in app.js var mysharedata; ... angular.module('starter', ['ionic', 'starter.controllers', 'starter.services']) // in controller.js ... .controller('friendsctrl', function($scope, friends) { $scope.friends = friends.all(); mysharedata = friends.all(); // or // mysharedata = $scope.friends; })

now can utilize mysharedata @ on non angular js. off course of study need check mysharedata has value or not before can utilize it.

javascript angularjs jsp angularjs-scope

No comments:

Post a Comment