How to set some variable in angular scope from a jsp

  1. Inject it as a global and access via $window. For eg. have your server side .jsp render a script tag with a global var like
    <script type="type/javascript">
       var pass = 'whatevervalue';
    </script>

and access it in your controller with $window

    angular.module('yourapp').controller('YourCtrl', $window){
        console.log($window.pass);
    }

Uday Ogra

Connect with me at http://facebook.com/tendulkarogra and lets have some healthy discussion :)

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *