JavaScript AngularJS UI Router reload not working angularjs route reload,angularjs router reload page,angularjs routing reload

I have two states in my current apps, which is login and register. If I just open my website towards localhost:8001, it is automatically redirect to /login because I've set

$urlRouterProvider.otherwise('/login')

But if I open my website towards localhost:8001/asdf, it does not redirect to /login. It just print not found.

What am I missing?

Here is my full code

app.module.js

var myApp = angular.module('myApp', ['routesApp']);

app.routes.js

var routesApp = angular.module('routesApp', ['ui.router','loginApp']);

routesApp.config(['$stateProvider', '$urlRouterProvider', '$locationProvider', function($stateProvider, $urlRouterProvider, $locationProvider) {  

  $urlRouterProvider.otherwise('/login');

  $locationProvider.html5Mode(true);

}]);

login.routes.js

routesApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
    $stateProvider
        .state('login', {
            url: '/login',
            templateUrl: 'app/components/login/login.html',
            controller: 'loginController'
        });
});

register.routes.js

routesApp.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
    $stateProvider
        .state('register', {
            url: '/register',
            templateUrl: 'app/components/register/register.html',           
        });
});

login.controller.js

var loginApp = angular.module('loginApp', ['ngAnimate']);

loginApp.config(function($sceDelegateProvider, $httpProvider) {
    $sceDelegateProvider.resourceUrlWhitelist([
    // Allow same origin resource loads.
    'self'
    ])
});

var loginController = function($scope){
    //test controller
}

loginApp.controller('loginController', loginController);

index.html

<!DOCTYPE html>
<html>

  <head>
    <title>MyApp</title>
    <base target='_blank' href="/">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- CSS -->
    <link target='_blank' href="assets/css/bootstrap.css" rel="stylesheet">
    <link target='_blank' href="assets/css/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet/less" type="text/css" target='_blank' href="assets/less/phinisi.less">
    <link rel="stylesheet/less" type="text/css" target='_blank' href="assets/less/dropdown.less" />
    <!-- JavaScript -->
    <script src="bower_components/angular/angular.min.js"></script>
    <script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
    <script src="bower_components/angular-animate/angular-animate.min.js"></script>
    <script src="assets/js/angular-payments.js"></script>
    <script src="assets/js/jquery-2.1.3.min.js"></script>
    <script src="assets/js/bootstrap.js"></script>
    <script src="assets/js/ui-bootstrap-0.12.1.min.js"></script>

    <script src="app/app.module.js"></script>
    <script src="app/app.routes.js"></script>

    <!-- Login Script -->
    <script src="app/components/login/login.controller.js"></script>    
    <script src="app/components/login/login.routes.js"></script>

    <!-- Register Script --> 
    <script src="app/components/register/register.routes.js"></script>    

    <script src="assets/js/less.js"></script>


  </head>

  <body ng-app="myApp">
    <div ui-view></div>  
  </body>

</html>
Answer:1

I'm trying to make a box follow the cursor on mousemove. However, it should stop following the mouse if the user clicks the box the user's mouse leaves the surrounding div Here's what the current ...

I'm trying to make a box follow the cursor on mousemove. However, it should stop following the mouse if the user clicks the box the user's mouse leaves the surrounding div Here's what the current ...

What is the difference between the following two functions as far as promises are concerned? var service = { someFunction: function() { return $http.get('url').then(function (response) { ...

What is the difference between the following two functions as far as promises are concerned? var service = { someFunction: function() { return $http.get('url').then(function (response) { ...

  1. javascript promises function
  2. javascript promise function example
  3. javascript promise function return value
  4. javascript promise function parameters
  5. javascript promise function return
  6. javascript promise function arguments
  7. javascript promise function call
  8. javascript promise function then
  9. javascript promise function variable
  10. js promises function
  11. javascript promise function chain
  12. javascript promise function name
  13. javascript promise function implementation
  14. js promise function example
  15. js promise function call
  16. js promise function then
  17. javascript promises callback function
  18. javascript create promise function
  19. javascript promise arrow function
  20. javascript promise recursive function

Edit I figured out that it is actually fading out, it just removes the background image before it starts the fade so I can't see it...duh. I just removed the .css('background','') so it fades out now....

Edit I figured out that it is actually fading out, it just removes the background image before it starts the fade so I can't see it...duh. I just removed the .css('background','') so it fades out now....

  1. trouble transitioning out of swaddle
  2. trouble transitioning from one activity to another
  3. trouble transitioning to sippy cup
  4. trouble transitioning
  5. trouble transitioning from bassinet to crib
  6. trouble transitioning from breast to bottle
  7. trouble transitioning from bottle to sippy cup
  8. trouble transitioning to toddler bed
  9. trouble transitioning to kindergarten
  10. trouble transitioning to adulthood
  11. trouble transitioning from crib to bed
  12. trouble transitioning baby to crib
  13. trouble transitioning from swaddle
  14. trouble transitioning to table food

Can someone give me an example of how to make an ajax call by JQuery within an HTML page to a Java Servlet (please post the full code of the html page, the call and the Servlet Class). I want to do ...

Can someone give me an example of how to make an ajax call by JQuery within an HTML page to a Java Servlet (please post the full code of the html page, the call and the Servlet Class). I want to do ...

  1. jquery ajax java servlet example
  2. jquery post java servlet
  3. jquery datatables java servlet example
  4. jquery call java servlet
  5. jquery to java servlet
  6. jquery ajax post java servlet
  7. jquery file upload java servlet example
  8. jquery file upload java servlet
  9. jquery validate remote java servlet
  10. jquery ajax jsp servlet java example
  11. jquery ajax request to java servlet
  12. jquery ajax java servlet
  13. jquery ajax json java servlet example
  14. jquery java servlet example