Error when using css own ionic 2

0
  

Css example:

.ion-content {

background-color: #000000;

}
  

home.ts

    import { Component } from '@angular/core';
    import { NavController, ViewController } from 'ionic-angular';
    import { HomeService } from './home.service';
    import { MenuPage } from '../menu/menu';


    @Component({
        selector: 'page-home',
        templateUrl: 'home.html',
        styleUrls: ['home.css'],
        providers: [
          HomeService
        ]
    })
  

Only returning error:

polyfills.js:3GET http://localhost:8100/home.css 404 (Not Found)
e @ polyfills.js:3
t.scheduleTask @ polyfills.js:3
e.scheduleMacroTask @ polyfills.js:3
(anonymous) @ polyfills.js:3
send @ VM6726:3
ResourceLoaderImpl.get @ resource_loader_impl.js:44
DirectiveNormalizer._fetch @ directive_normalizer.js:40
(anonymous) @ directive_normalizer.js:130
DirectiveNormalizer._loadMissingExternalStylesheets @ directive_normalizer.js:130
DirectiveNormalizer.normalizeExternalStylesheets @ directive_normalizer.js:112
(anonymous) @ directive_normalizer.js:65
t.invoke @ polyfills.js:3
e.run @ polyfills.js:3
(anonymous) @ polyfills.js:3
t.invokeTask @ polyfills.js:3
e.runTask @ polyfills.js:3
i @ polyfills.js:3
polyfills.js:3 Unhandled Promise rejection: Failed to load home.css ; Zone: <root> ; Task: Promise.then ; Value: Failed to load home.css undefined
o @ polyfills.js:3
r @ polyfills.js:3
i @ polyfills.js:3
invoke @ polyfills.js:3
polyfills.js:3 Error: Uncaught (in promise): Failed to load home.css
    at s (polyfills.js:3)
    at s (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at e.runTask (polyfills.js:3)
    at i (polyfills.js:3)
    at XMLHttpRequest.invoke (polyfills.js:3)
o @ polyfills.js:3
r @ polyfills.js:3
i @ polyfills.js:3
invoke @ polyfills.js:3

I want to change the background of the app and also use my css on other pages, what am I doing wrong?

    
asked by anonymous 28.02.2017 / 15:30

1 answer

1

Solution found:

  

In home.scss:

.fundo {
  background-color: #000000;
}
  

and no home html:

<ion-content padding class="fundo">
    
28.02.2017 / 17:35