Niraj Singh

Niraj Singh

  • NA
  • 50
  • 36.3k

Issue with UIrouter with asp.net SPA

Oct 13 2016 7:29 AM
Hello Dear,
 
I am creating a project in asp.net MVC Single Page Application and trying to implement angularjs. Here problem is which i am facing that when i want to open html template then it gives error path not found. if I open template after creating a server side controller for that then it gets open. Here I need to open html template without server side action. what should i do?
Please have a look at my angular UIrouting code
'use strict';
var app=angular
.module('sbAdminApp', [
'ui.router'
])
app.config(['$stateProvider', '$urlRouterProvider', '$locationProvider',
function ($stateProvider, $urlRouterProvider, $locationProvider) {
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode({
enabled: false,
requireBase: false
});
$stateProvider
.state('Home', {
url: '/',
views: {
'user': {
templateUrl: '/Views/Home/Test.html',
data: { pageTitle: 'Demo Home' },
},
},
})
}]);
 

Answers (2)