0

Sorry Guys this is my first question in stackoverflow, so I edited the question in order to be more clear.

I have an angular app and I would like that the users could check their profile as following "http://myapp.com/username" instead of "http://myapp.com/#/user/username" without the html5mode enable. How can I achieve this?

Thanks in advance.

JGL
  • 11
  • 2
  • It's really difficult to understand what you're asking. Why don't you start by explaining what you want to achieve instead of how you'd like to achieve it. – Phil Mar 12 '15 at 05:09
  • you can manually bootstrap angular instead of using `ng-app`. see https://docs.angularjs.org/guide/bootstrap#!/ – Claies Mar 12 '15 at 05:19
  • but yes, try not to fall into the XY Problem here.... what you are describing doesn't sound standard. http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378 – Claies Mar 12 '15 at 05:21

1 Answers1

0

can you try calling your ajax call in .run angular module.

go with reference http://jsfiddle.net/lovedota/qpwwm8bn/

> angular.module('app', ['ngRoute', 'app.auth']) 
> .factory('AuthService', ['$q', function ($q) {} 
> .config(['$routeProvider', function($routeProvider) {
>             $routeProvider.             
>               otherwise({
>                 redirectTo: '/'
>               });
>       }])
> 
> .run(['$http', function($http){
>         // make your ajax call or you can inject another module which bring user id
>     }])
Dilip Tirumala
  • 371
  • 1
  • 10