While working in jsp with some parts common in few pages and ran into a problem to attach multiple apps to a single jsp page. After doing lot of search I found this one the best solution. Create a new app and take all other apps as an parameter. Example:
On jsp page -
<script type="text/javascript">
var rootApp = angular.module('rootApp', ['loginApp','searchApp','autoCompleteApp']);
</script>
Now add the
ng-app="rootApp"
on the top and you need not to add other app in ng-app, you can directly call controller defined in these apps as :
ng-controller="loginController"
ng-controller="searchController"
ng-controller="autoCompleteController"
0 Comment(s)