Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using AngularJs in Asp.Net mvc 4. I would like to use the template in $routeProvider instead of templateUrl

I wan to use this one

$routeProvider.when('/url', { template: '/view/page.html',controller: 'myCtrl' })

Instead of this one

$routeProvider.when('/url', { templateUrl: '/view/page',controller: 'myCtrl' })

I don't want to create methods in controller(that only contains return PartialView()) every time I need to implement a page. Is it possible?

Thanks.

share|improve this question
    
do you want the content within the /view/page.html to be displayed or simply you want to show like /view/page.html printed –  NidhishKrishnan Aug 8 at 5:31
    
Mixing server side and client side routing, or even trying to will lead to a lot of pain. You may need to revisit some angular js fundamental - specifically to understand that there is no server side dependency when working within angular. –  Abhinav Gujjar Aug 8 at 5:35
    
@NidhishKrishnan I want to implement the content in /view/page.html. –  user3916743 Aug 8 at 7:33
    
I am not trying to mix their routing, i am just trying not to use any web controllers just to render the page –  user3916743 Aug 8 at 7:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.