0

I have an Angular2 App that can show a modal. For that i call an injectable method inside a Js class:

@Injectable()
public showErrorDialog(errorMessage:string, isError:boolean) {

    this.modal.alert()
    .size('sm')
    .showClose(true)
    .title("Modal Title")
    .body(errorMessage)
    .open();
}

Now i would customize body of modal, by changing background, and text style. How can i do?

giozh
  • 9,868
  • 30
  • 102
  • 183

1 Answers1

0

You have a few options - are you using this via a component? You could add the styles or styleUrl property (https://angular.io/docs/ts/latest/guide/component-styles.html). Alternatively you could also take a look at how the modal is constructed using Chrome's Developer tool (or your preferred browser's developer tool) and find out what classes are being used by the modal and add a custom css file to set your desired values.

Tamas
  • 10,953
  • 13
  • 47
  • 77
  • i'm using inside app.component (the main component of whole app) – giozh May 05 '17 at 09:44
  • You could try to add something like this to your component -> style: [' .text-intro span { color: #0f0;} '] - this should change the title to be green. As I said earlier use the chrome dev tool to check what elements you can style. – Tamas May 05 '17 at 09:49