Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. public translations = {
  2. uiTranslations: {},
  3. pageTranslations: {},
  4. validations: {},
  5. defaults: {},
  6. errors: {},
  7. resetPasswordTranslations: {}
  8. };
  9.  
  10. constructor(
  11. private appCtrl: App,
  12. private modalCtrl: ModalController,
  13. private navCtrl: NavController,
  14. private auth: AuthenticationService,
  15. private nTranslate: nTranslateService,
  16. private propSvc: PropertiesService,
  17. private formBuilder: FormBuilder,
  18. private loadingCtrl: LoadingController,
  19. private alertCtrl: AlertController) {
  20.  
  21. this.user = this.formBuilder.group({
  22. username: ['', Validators.compose([Validators.required])],
  23. password: ['', Validators.required]
  24. });
  25.  
  26. this.username = this.user.controls['username'];
  27. this.password = this.user.controls['password'];
  28. }
  29.  
  30. ionViewWillEnter() {
  31. // Lets "preload" the reset password translations so we have them in localStorage

  32.  
  33. let resetPasswordTranslations = this.nTranslate.getSection('resetpassword').toPromise().then(() => {
  34.  
  35. res => this.translations.resetPasswordTranslations = res
  36.  
  37.  
  38. });
  39. let pageTranslations = this.nTranslate.getSection('login').toPromise().then(res => this.translations.pageTranslations = res);
  40. let uiTranslations = this.nTranslate.getSection('ui-pages').toPromise().then(res => this.translations.uiTranslations = res);
  41. let validationTranslations = this.nTranslate.getSection('validation').toPromise().then(res => this.translations.validations = res);
  42. let defaultTranslations = this.nTranslate.getSection('default').toPromise().then(res => this.translations.defaults = res);
  43. let errorTranslations = this.nTranslate.getSection('error').toPromise().then(res => this.translations.errors = res);
  44.  
  45. return Promise.all([resetPasswordTranslations, pageTranslations, uiTranslations, validationTranslations, defaultTranslations, errorTranslations]);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement