0

el angular.cli.json es el que sigue

    {
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "daoiz-y-velarde"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "styles.css",
        "css/style.css",
        "css/form.css"
      ],
      "scripts": ["../node_modules/jquery/dist/jquery.min.js"],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}

y la estructura de proyecto es:

src/

>    app/
>        admin/
>              eventos/
>              noticias/
>              puntuaciones/
>              reglamentos/
>              usuarios/
>              admin.component.css
>              admin.component.ts
>              admin.component.html
>       contacto/
>       directives/
>       inicio/
>       interfaces/
>       login/
>       modelo/
>       nosotros/
>       noticias/
>       pipes/
>       politica/
>       registro/
>       reglamentos/
>       request/
>       services/
>       servicios/
>       app.component.css
>       app.component.html 
        app.component.spec.ts
        app.component.ts
        app.module.ts
    assets/
    css/
        camera.css
        font-awesome.css
        form.css
        grid.css
        ie.css
        jquery.fancybox-1.3.4.css
        reset.css
        style.css
        superfish.css
    environments/
    fonts/
    imaGES/
...

El archivo index.html es

    <!doctype html>
<html lang="es">
<head>
  <meta charset="iso-8859-1">
  <title>Club de tiro Daoiz y Velarde</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
     <meta name = "format-detection" content = "telephone=no" />
     <link rel="icon" href="images/favicon.ico" type="image/x-icon">
     <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
     <link rel="stylesheet" type="text/css" href="/css/camera.css">
     <link rel="stylesheet" type="text/css" href="/css/font-awesome.css">
     <link rel="stylesheet" type="text/css" href="/css/form.css">
     <link rel="stylesheet" type="text/css" href="/css/grid.css">
     <link rel="stylesheet" type="text/css" href="/css/ie.css">
     <link rel="stylesheet" type="text/css" href="/css/jquery.fancybox-1.3.4.css">
     <link rel="stylesheet" type="text/css" href="/css/style.css">
     <link rel="stylesheet" type="text/css" href="/css/reset.css">
     <link rel="stylesheet" type="text/css" href="/css/superfish.css">
</head>
<body id="top">
    <app-root></app-root>
</body>
</html>

style.css es:

@import "reset.css";
@import "grid.css";
@import "superfish.css";

@import url(http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700);
@import url(http://fonts.googleapis.com/css?family=Open+Sans:600);


html, body {
    background: url(../images/bg.jpg) 0 0 repeat;
    width: 100%;
    position: relative;
    font: normal 14px/20px 'Ubuntu', sans-serif;
    color: #5e5a59;
    text-align: left;
}
...

y el error en el explorador es:

localhost/:1 Refused to apply style from 'http://localhost:4200/css/camera.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/ie.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/font-awesome.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/form.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/grid.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/reset.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/jquery.fancybox-1.3.4.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/superfish.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/camera.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/font-awesome.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/form.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/grid.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/ie.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/jquery.fancybox-1.3.4.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/reset.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
localhost/:1 Refused to apply style from 'http://localhost:4200/css/superfish.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
webpack-internal:///../../../core/esm5/core.js:3857 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
127.0.0.1:8080/Daoiz/autenticacion Failed to load resource: net::ERR_CONNECTION_REFUSED

El código de la parte cliente está en: https://www.dropbox.com/sh/kut5h80hnz7uylr/AADXcvw6NEHepi5NaBpWH_Dya?dl=0

El war del servidor es: https://www.dropbox.com/s/0nmo7s0908u992e/ProgramaHospitalServicios.war?dl=0

La bbdd es:

https://www.dropbox.com/s/14a4iwr0a63yvv4/Dump20180228.sql?dl=0

8
  • Puedes poner la estructura de tu proyecto? Ya que error de sintaxis no se ve. el 27 feb. 2018 a las 13:02
  • 1
    Sigue sin verse la carpeta css donde estarían tus styles. el 27 feb. 2018 a las 13:19
  • Ya se ve........................... el 27 feb. 2018 a las 13:37
  • 1
    Error: Can't resolve 'reset.css' Revisaste reset.css que no este causando problemas en tu archivo style.css ? el 27 feb. 2018 a las 14:00
  • El problema podría estar relacionado con tener rutas relativas en lugar de absolutas (o relativas a la raíz). ¿Dónde cargas reset.css en tu código?
    – Alvaro Montoro
    el 27 feb. 2018 a las 14:25

1 respuesta 1

0

prueba lo siguiente:

"styles": [
    "styles.css",
    "./css/style.css",
    "./css/form.css"
  ],

y por cada cambio que realizes en el .angular-cli.json, asegurate de reiniciar el servidor: ng serve

8

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.