Keshav Keshav - 1 year ago 65
AngularJS Question

load template url from $http request in state routing

I want to load templateurl from $http call.

.state('home', {
url: '/',
templateUrl: will be served by $http call from server

Please suggest how i will implement this.

Answer Source

Angular has done it it in most elegant way .If you want to call your backend controller to request a jsp page for templateurl just call $http url like this

.state('inbox', {
        url: '/inbox',
        controller : 'inboxController'

that url respond with jsp page in my case inboxrecord.jsp that will be rendered.