mercredi 2 décembre 2015

AngularJS Web Application

I have a problem with Web Application, I try to do when a user enter on /#/home to display a text.

<html>
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular-route.js"></script>   
    <script>
    var app = angular.module('cacat', ['ngRoute']);
    app.config(function($routeProvider, $locationProvider) {
      $routeProvider.
        when('/home', {
          template: 'DADA'
        }).
        otherwise({
          redirectTo: '/'
        });

      if (window.history && window.history.pushState) {
        $locationProvider.html5Mode({
          enabled: true,
          requireBase: false
        });
      }
    });
    </script>
</head>
<body ng-app="cacat">
</body>

I tried 127.0.0.1/#/home, 127.0.0.1/home and both doesn't work.

Aucun commentaire:

Enregistrer un commentaire