angularjs - How to create dynamic url in Angular Js -
right when hit below url ,
angularproj.localhost.com
it open login page , above url changed
angularproj.localhost.com/#/login . admin login
now per project requirement , have multiple customers , have logins.
so need create seperate urls them.
say first customer c1.so url angularproj.localhost.com/c1.
and when hit angularproj.localhost.com/c1 in browser should open c1 customer login page.
i have tried below no luck.
$stateprovider
.state('/:customer', { url: "/", templateurl: "app/views/login/customer/login.html", data: { pagetitle: 'example view' } })
trying way. should work.
var app = angular.module('tutorialwebapp', [ ' ngroute' ]); /** * configure routes */ app.config(['$routeprovider', function ($routeprovider) { $routeprovider // home .when("/", {templateurl: "partials/home.html", controller: "pagectrl"}) // pages .when("/about", {templateurl: "partials/about.html", controller: "pagectrl"}) // else 404 .otherwise("/404", {templateurl: "partials/404.html", controller: "pagectrl"}); }]);
Comments
Post a Comment