Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public translations = {
- uiTranslations: {},
- pageTranslations: {},
- validations: {},
- defaults: {},
- errors: {},
- resetPasswordTranslations: {}
- };
- constructor(
- private appCtrl: App,
- private modalCtrl: ModalController,
- private navCtrl: NavController,
- private auth: AuthenticationService,
- private nTranslate: nTranslateService,
- private propSvc: PropertiesService,
- private formBuilder: FormBuilder,
- private loadingCtrl: LoadingController,
- private alertCtrl: AlertController) {
- this.user = this.formBuilder.group({
- username: ['', Validators.compose([Validators.required])],
- password: ['', Validators.required]
- });
- this.username = this.user.controls['username'];
- this.password = this.user.controls['password'];
- }
- ionViewWillEnter() {
- // Lets "preload" the reset password translations so we have them in localStorage
- let resetPasswordTranslations = this.nTranslate.getSection('resetpassword').toPromise().then(() => {
- res => this.translations.resetPasswordTranslations = res
- });
- let pageTranslations = this.nTranslate.getSection('login').toPromise().then(res => this.translations.pageTranslations = res);
- let uiTranslations = this.nTranslate.getSection('ui-pages').toPromise().then(res => this.translations.uiTranslations = res);
- let validationTranslations = this.nTranslate.getSection('validation').toPromise().then(res => this.translations.validations = res);
- let defaultTranslations = this.nTranslate.getSection('default').toPromise().then(res => this.translations.defaults = res);
- let errorTranslations = this.nTranslate.getSection('error').toPromise().then(res => this.translations.errors = res);
- return Promise.all([resetPasswordTranslations, pageTranslations, uiTranslations, validationTranslations, defaultTranslations, errorTranslations]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement