@justbe-ionic-angular/alpha
v4.0.3
Published
jb ionic alpha module // experimental please dont use
Downloads
55
Readme
Ionic Alpha
Ionic alpha have common code that includes :
1) Root Component
2) Sidenavigation
3) DeciderPage
4) Application Update
5) Auth
Root Component
This is the starting point, This component is passed to ionic module that is then the starting point of ionic application.
Following are the task done by the root component:
1) Checks the alpha configurations and enable or disables the sidenav
2) Navigates to decider page
DeciderPage
Following are the tasks done by decider page
1) if application update configurations are provided it checks for application updates
2) if application updates are available then navigates to appUpdatePage.
3) Checks if user is already authenticated or not if yes, then navigates to home page, else navigates to auth page
Application Update
This page is opened if update is vailable and then playstore or appstore is opened according to your platform
Sidenav Page
This is the wrapper page to which you can pass your component which can be shown on sidenav
Auth
There are three way by which you can loggedin in to the application
1) Facebook
2) Google
3) Mobile OTP
Installation
Use the node package manager npm to install @justbe-ionic-angular/alpha.
npm install @justbe-ionic-angular/alpha --save
Usage
import AlphaModule into your root app.module and pass RootComponent to IonicModule
import { NgModule } from '@angular/core';
import { AlphaModule, RootComponent } from '@justbe-ionic-angular/alpha';
@NgModule({
declarations: [
..
],
imports: [
..,
IonicModule.forRoot(RootComponent, {
..,
tabsHideOnSubPages: true,
backButtonText: '',
..,
}),
AlphaModule,
..,
]
})
export class AppModule { }
configure AlphaModule at entry point of your application
import { Component } from '@angular/core';
import { AlphaService } from "@justbe-ionic-angular/alpha";
import { HomePage, SliderPage, SidenavPage } from "../path/to/your/pages"
@Component({
templateUrl: 'root.component.html'
})
export class RootComponent {
..
constructor(
..,
private alphaService: AlphaService,
..
){}
this.alphaService.setConfigurations({
endPoint: AppConfig.API_ENDPT,
type: 'api',
ifAlreadyLoggedIn: { klass: HomePage },
sliderConfigurations: { klass: SliderPage },
sidenavConfigurations: { klass: SidenavPage },
authConfigurations: { afterLoginSuccess: { klass: HomePage } },
appUpdateConfigurations: {
appName: AppConfig.APP_NAME,
appVersion: AppConfig.APP_VERSION,
cfEndPoint: AppConfig.CF_API_ENDPT,
playstoreUrl: "market://details?id=com.beyoutech.one.louve.coach",
itunesUrl: "itms-apps://itunes.apple.com/app/id1418392416"
}
})
}
License
cordova plugin need to be install manually ionic cordova plugin add cordova-plugin-app-preferences
this will automatically included as it is in dependency npm install --save @ionic-native/app-preferences@4