Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. let prompt = Alert.create({
  2. title: 'Subscribe to our service',
  3. message: "All the fields are necessary",
  4. inputs: [
  5. ...
  6. {
  7. name: 'path',
  8. placeholder: 'Path',
  9. value: JSON.stringify(this.testArray)
  10. },
  11. {
  12. name: 'cycle',
  13. placeholder: 'Cycle: once/weekly/monthly'
  14. },
  15. {
  16. name: 'object_type',
  17. placeholder: 'Farm/Solarpanel/plain'
  18. },
  19. ],
  20. buttons: [
  21. {
  22. text: 'Cancel',
  23. handler: () => {
  24. console.log('Cancel clicked');
  25. }
  26. }
  27. ]
  28. });
  29.  
  30. this.nav.present(prompt);
  31.  
  32. import { Modal, NavController, NavParams } from 'ionic-angular';
  33.  
  34. @Component(...)
  35. class YourPage {
  36.  
  37. constructor(nav: NavController) {
  38. this.nav = nav;
  39. }
  40.  
  41. presentSubscriptionModal() {
  42. let subscriptionModal = Modal.create(Subscription, { yourParam: paramValue });
  43. this.nav.present(subscriptionModal);
  44. }
  45.  
  46. }
  47.  
  48. @Component(...)
  49. class Subscription{
  50.  
  51. constructor(params: NavParams) {
  52. let param = params.get('yourParam');
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement