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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -