route problem $ routeProvider, angularjs

0

It turns out that I have an "admin" view that contains bootstrap design where I access a login to later enter the modules of the system, but within my routes I have one that should send me to a main page (other content) and this main page contains material design the problem I have is that when you start this main page applies bootstrap, when you should not apply bootstrap but material design.

attached code:

    'use strict';

/**
 * @ngdoc overview
 * @name apiFrontApp
 * @description
 * # apiFrontApp
 *
 * Main module of the application.
 */
angular
  .module('apiFrontApp', [
    'authService',
    'ngAnimate',
    'ngAria',
    'ngCookies',
    'ngMessages',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'satellizer',
    'toastr'
  ])
  .config(function ($routeProvider, $authProvider, $locationProvider) {
    $locationProvider.hashPrefix('');
    $authProvider.loginUrl = 'http://localhost:808/laravel-angular-project/api/public/auth_login';

    $routeProvider
      .when('/', {
        templateUrl: 'views/main.html',
        controller: 'MainCtrl',
        controllerAs: 'main'
      })
      .when('/about', {
        templateUrl: 'views/about.html',
        controller: 'AboutCtrl',
        controllerAs: 'about'
      })
      .when('/admin', {
        templateUrl: 'views/login.html',
        controller: 'LoginCtrl',
        controllerAs: 'login'
      })
      .when('/principal',{
        templateUrl: 'principal/index.html'
      })
      .otherwise({
        redirectTo: '/'
      });
  })
  .run(function($rootScope, $location, authUser, toastr){
      var rutasPrivadas = ['/','/about'];
      var rutaPrivadaLogeado = ['/admin'];

      $rootScope.$on('$routeChangeStart',function(){
        if (($.inArray($location.path(), rutasPrivadas) !== -1) && !authUser.isLoggedIn()) {
          toastr.error('Debe iniciar sesion para poder continuar.','Mensaje');
          $location.path('/admin');
        }
        //No mostrar la vista login si ya se ha iniciado sesion
         if (($.inArray($location.path(), rutaPrivadaLogeado) !== -1) && authUser.isLoggedIn()) {
           $location.path('/');
        }
      });
  });

the route that must contain material design is this:

.when('/principal',{
        templateUrl: 'principal/index.html'
      })

where "main" is a folder that contains the following files:

  • principal /
  • bower_components
  • images
  • scripts
  • styles
  • styles-scss
  • bower.json
  • favicon
  • index.html

if I run from the browser only index if it applies material design. How can I make it through the routes if I apply material design and not bootstrap?

    
asked by JG_GJ 07.02.2018 в 05:49
source

0 answers