I really have no clue what is going on.
My app.component.ts file looks like below
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
import { PastVideosPage } from '../pages/past-videos/past-videos';
import { HomePage } from '../pages/home/home';
import { TabsPage } from '../pages/tabs/tabs';
import { SignInPage } from "../pages/sign-in/sign-in";
import { SideMenu } from "../pages/side-menu/side-menu";
import { SharePromoVidModal } from "../page-modals/share-promo-vid/share-promo-vid";
import { AuthorizationService } from "../providers/authorization-service";
@NgModule({
declarations: [
MyApp,
PastVideosPage,
HomePage,
TabsPage,
SignInPage,
SideMenu,
SharePromoVidModal
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
PastVideosPage,
HomePage,
TabsPage,
SignInPage,
SideMenu,
SharePromoVidModal
],
providers: [AuthorizationService]
})
export class AppModule {}
And a component where i’m trying to use it looks like this
import { Component } from '@angular/core';
import { NavController, ModalController } from 'ionic-angular';
import { VimeoService, VimeoVideoConfig } from "../../providers/vimeo-service";
import { SharePromoVidModal } from "../../page-modals/share-promo-vid/share-promo-vid";
import { SocialSharingService } from "../../providers/social-sharing-service";
import { AuthorizationService } from "../../providers/authorization-service";
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [VimeoService, SocialSharingService]
})
export class HomePage {
constructor(private navCtrl: NavController,
private vimeoService: VimeoService,
private sharingService: SocialSharingService,
private modalController: ModalController,
private authService: AuthorizationService) {
}
//Used to display the promo video modal upon pressing share HisWord365 button
public showSharePromoVidModal(){
console.log(this.authService.token);
}
}
Lastly the Service looks like this. (There is a part of the code where I do set the token but its not included for brevity)
export class AuthorizationService {
private _token: string;
private _refreshToken: string;
//== Token
get token(){
return this._token;
}
//== Refresh Token
get refreshToken(){
return this._refreshToken;
}
}