javascript - How to remove index.html from url on website based on angularjs -
i didn't find way remove index.html url, because looks ugly.
mydomain.com/index.html#/myview1 mydomain.com/index.html#/myview2
is there way remove part, url clear user is.
mydomain.com/myview1 mydomain.com/myview2
tnx in advance time.
edit: find way work like:
mydomain.com/#/myview1 mydomain.com/#/myview2
which pretty better index.html.
but still if there way shorter solution let me know.
maybe approach help:
add $locationprovider.hashprefix();
, removes index.html in url, in app.js config. don't forget add new dependency. after app.js similar this:
angular.module('myapp', [ 'ngroute' ]). config(['$locationprovider', '$routeprovider', function($locationprovider, $routeprovider) { $locationprovider.hashprefix(); // removes index.html in url $routeprovider.otherwise({redirectto: '/someroute'}); }]);
note not remove hashtag. can find new route at: .../app/#/someroute
Comments
Post a Comment