Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import { ToastrNameService } from './datas/mock-datas.service';
  3. import { ToasterServiceMethods } from './toastr-services/toastr.service';
  4.  
  5. @Component({
  6. selector: 'app-root',
  7. templateUrl: './app.component.html',
  8. styleUrls: ['./app.component.css']
  9. })
  10. export class AppComponent implements OnInit{
  11. toastrNames;
  12. success;
  13. info;
  14. error;
  15. warning;
  16. constructor(private toastrName:ToastrNameService, private toastr:ToasterServiceMethods){}
  17. showToastr(toasterInfo){
  18. if(toasterInfo == "Success"){
  19. this.success = this.toastr.successToaster()
  20. }else if(toasterInfo == "Info"){
  21. this.info = this.toastr.infoToaster()
  22. }else if(toasterInfo == "Warning"){
  23. this.info = this.toastr.warningToaster()
  24. }
  25. else if(toasterInfo == "Error"){
  26. this.info = this.toastr.errorToaster()
  27. }
  28. }
  29. ngOnInit(){
  30. //Toaster metodlarımı çektiğim satır
  31. this.toastrNames = this.toastrName.getToastrNames();
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement