Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. ngOnInit() {
  2. this.usuario = localStorage.getItem("user");
  3. this.entityCtrl.getEntityByUser(this.usuario).subscribe(
  4. response => {
  5. this.allFathers= response["body"];
  6. this.father =
  7. parseInt(localStorage.getItem("father")) != null
  8. ? parseInt(localStorage.getItem("father"))
  9. : this.allFathers[0]["id"];
  10. localStorage.setItem("father", this.father.toString());
  11. },
  12.  
  13. (error: any) => {
  14. console.log(error);
  15. },
  16.  
  17. () => {
  18. this.entityCtrl
  19. .getGroupsByEntityAndUser(
  20. localStorage.getItem("father"),
  21. localStorage.getItem("user")
  22. )
  23. .subscribe(
  24. response => {
  25. this.AllSons= response["body"];
  26. this.son=
  27. parseInt(localStorage.getItem("son")) != null
  28. ? parseInt(AllSons.getItem("som"))
  29. : this.groupsTodos[0]["id"];
  30. localStorage.setItem("son", this.grupo.toString());
  31. },
  32. (error: any) => {
  33. console.log(error);
  34. }
  35. );
  36. }
  37. );
  38. }
  39.  
  40. ngOnInit() {
  41. console.log(localStorage.getItem("grupo")) VALOR NO LLEGA
  42. this.dashboardCtrl.getMarkers(localStorage.getItem("son")).subscribe(
  43. response => {
  44. this.markers = response["body"]["data"];
  45. this.timezone = response["body"]["timezone"];
  46. },
  47. error => {
  48. console.log(error);
  49. }
  50. );
  51.  
  52. @Injectable()
  53. export class MessageService {
  54.  
  55. private subject = new Subject<any>();
  56.  
  57. sendMessage(message: any) {
  58. this.subject.next(message);
  59. }
  60.  
  61. clearMessage() {
  62. this.subject.next();
  63. }
  64.  
  65. getMessage(): Observable<any> {
  66. return this.subject.asObservable();
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement