Hi everybody, I've a problem with the routes in a test in my localhost. I read others questions similar to mine but these not helped me. I'm working with the next work environment: 1. AngularJS (version 1.5.0-rc.2) 2. ui-router 3. xammpp I want create dinamyc views in a SPA but when I type the route the app show me the next screen  My test is formed for: **index.html** <!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <base href="/projects/inytal/"> <title>Ingenierías y Técnicas Alimentarias - INYTAL</title> <link rel="stylesheet" type=text/css"" href="statics/css/general.css" media="screen,handheld,tv"> <!--[if lt IE 9]> <script src="https://cdn.jsdelivr.net/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://cdn.jsdelivr.net/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body ng-app="app"> <header role="heading"> <h1>INGENIERIA Y TECNICAS ALIMENTARIAS</h1> <nav role="navigation"> <ul> <li><a ui-sref="inicio">Quienes Somos</a></li> <li><a ui-sref="productos">Productos</a></li> <li><a ui-sref="contactos">Contactos</a></li> </ul> </nav> </header> <main ui-view></main> <!-- Load scripts --> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-rc.2/angular.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.18/angular-ui-router.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="app/app.module.js"></script> <script src="login/login.js"></script> </body> </html> **app.module.js** (function(){ 'use strict'; var dependencies = []; angular .module('app', dependencies); })(); **login.js** (function(){ 'use strict'; angular .module('login.module', ['ui.router']) .config(loginRoute) .component('login', loginDirective); ////////////////////////////////////////////// loginRoute.$inject = ['$locationProvider', '$stateProvider', '$urlRouteProvider']; /* * Login Route * @description: Login route. We use a directive in the template property * @params: $locationProvider, $stateProvider, $urlRouteProvider (all of them injected) */ function loginRoute($locationProvider, $stateProvider, urlRouteProvider){ // use the HTML5 History API $locationProvider.html5Mode(true); $stateProvider .state('login', { template: '<login></login>' }) } /* * Login Directive * @description: Login directive. Where insolate scope to avoid rewrite parent's scope * @return: scope, url, templateUrl, controller, controllerAs */ function loginDirective(){ return { scope:{}, url: '/login', controller: loginController, controllerAs: 'vm', template:[ '<div>', '<h2>{{vm.title}}</ h2>', '</div>' ].join('') } } /* * Login controller * @description: Function for get the data */ function loginController(){ /* jshint validthis: true */ var vm = this; return vm.message='Login'; } })(); ** .htaccess** <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index RewriteRule (.*) index.html [L] </IfModule> Thanks for your help and best regards.
-- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
