<script type="text/javascript">
angular.module('ngView', ['ngRoute'],
function($routeProvider){
$routeProvider.when('/test',
{
template: '{{}}',
controller: function(){
console.log('controller');
$('div').first().html('<b>OK</b>');
}
}
);
}
);
</script>
This is all my angular code. In URL, i can access test by
file:///Users/tom/Documents/Projects/a4/index2.html#/test
file:///Users/tom/Documents/Projects/a4/index2.html#test
Both of the above two ways work.
But when I change #/test to /test
, it doesn't work.
How do I configure Angularjs to only use '/'
in URL path?