├── src
├── app
│ ├── detail
│ │ ├── detail.page.scss
│ │ ├── detail.page.html
│ │ ├── detail.page.ts
│ │ ├── detail.module.ts
│ │ └── detail.page.spec.ts
│ ├── home
│ │ ├── home.page.scss
│ │ ├── home.page.html
│ │ ├── home.page.ts
│ │ ├── home.module.ts
│ │ └── home.page.spec.ts
│ ├── tabs
│ │ ├── tabs.page.scss
│ │ ├── tabs.page.ts
│ │ ├── tabs.page.spec.ts
│ │ ├── tabs.module.ts
│ │ ├── tabs.page.html
│ │ └── tabs.router.module.ts
│ ├── about
│ │ ├── about.page.scss
│ │ ├── about.page.html
│ │ ├── about.page.ts
│ │ ├── about.module.ts
│ │ └── about.page.spec.ts
│ ├── contact
│ │ ├── contact.page.scss
│ │ ├── contact.page.ts
│ │ ├── contact.page.html
│ │ ├── contact.module.ts
│ │ └── contact.page.spec.ts
│ ├── public
│ │ └── auth
│ │ │ └── login
│ │ │ ├── login.page.scss
│ │ │ ├── login.page.html
│ │ │ ├── login.module.ts
│ │ │ ├── login.page.ts
│ │ │ └── login.page.spec.ts
│ ├── app.component.html
│ ├── app.scss
│ ├── app-routing.module.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ └── app.component.spec.ts
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── assets
│ └── icon
│ │ └── favicon.png
├── tsconfig.app.json
├── services
│ ├── authentication.service.ts
│ └── authGuard.service.ts
├── tsconfig.spec.json
├── main.ts
├── global.scss
├── test.ts
├── index.html
├── karma.conf.js
├── theme
│ └── variables.scss
└── polyfills.ts
├── ionic.config.json
├── e2e
├── tsconfig.e2e.json
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
└── protractor.conf.js
├── tsconfig.json
├── README.md
├── .gitignore
├── package.json
├── tslint.json
└── angular.json
/src/app/detail/detail.page.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/home/home.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/about/about.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/contact/contact.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/public/auth/login/login.page.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tabs-test",
3 | "integrations": {},
4 | "type": "angular"
5 | }
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/assets/icon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aaronksaunders/ionicv4-tabs-with-detail/HEAD/src/assets/icon/favicon.png
--------------------------------------------------------------------------------
/src/app/about/about.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | About
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "target": "es5"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-tabs',
5 | templateUrl: 'tabs.page.html',
6 | styleUrls: ['tabs.page.scss']
7 | })
8 | export class TabsPage {}
9 |
--------------------------------------------------------------------------------
/src/app/about/about.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-about',
5 | templateUrl: 'about.page.html',
6 | styleUrls: ['about.page.scss']
7 | })
8 | export class AboutPage {}
9 |
--------------------------------------------------------------------------------
/src/app/contact/contact.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-contact',
5 | templateUrl: 'contact.page.html',
6 | styleUrls: ['contact.page.scss']
7 | })
8 | export class ContactPage {}
9 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015"
7 | },
8 | "exclude": [
9 | "test.ts",
10 | "**/*.spec.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.deepCss('app-root ion-content')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/detail/detail.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | detail
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/app/detail/detail.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-detail',
5 | templateUrl: './detail.page.html',
6 | styleUrls: ['./detail.page.scss'],
7 | })
8 | export class DetailPage implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 |
3 | describe('new App', () => {
4 | let page: AppPage;
5 |
6 | beforeEach(() => {
7 | page = new AppPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toContain('The world is your oyster.');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "outDir": "./dist/out-tsc",
5 | "sourceMap": true,
6 | "declaration": false,
7 | "moduleResolution": "node",
8 | "emitDecoratorMetadata": true,
9 | "experimentalDecorators": true,
10 | "target": "es5",
11 | "lib": [
12 | "es2017",
13 | "dom"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ionicv4-tabs-with-detail
2 |
3 | - Updated to latest version
4 | - addressed issue with icons not showing up
5 | - addressed issue with bad animation to nested page
6 |
7 | ## See Another Ionic v4 Example
8 | https://github.com/aaronksaunders/ionic4-sidemenu-auth
9 |
10 | ## Blog Post
11 | https://dev.to/aaronksaunders/simple-ionic-tabs-app-with-child-routes-protected-routes-1k24
12 |
--------------------------------------------------------------------------------
/src/app/app.scss:
--------------------------------------------------------------------------------
1 | // App Styles
2 | // ----------------------------------------------------------------------------
3 | // Put style rules here that you want to apply to the entire application. These
4 | // styles are for the entire app and not just one component. Additionally, this
5 | // file can hold Sass mixins, functions, and placeholder classes to be imported
6 | // and used throughout the application.
--------------------------------------------------------------------------------
/src/app/home/home.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Home
4 |
5 |
6 |
7 |
8 | The world is your oyster.
9 |
10 | Next
11 |
12 |
13 | Logout
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/services/authentication.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from "@angular/core";
2 |
3 | @Injectable({
4 | providedIn: "root"
5 | })
6 | export class AuthenticationService {
7 | isLoggedIn = false;
8 |
9 | constructor() { }
10 |
11 | setLoggedIn(_value) {
12 | this.isLoggedIn = _value;
13 | }
14 | isAuthenticated(): boolean {
15 | return this.isLoggedIn;
16 | }
17 | }
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "baseUrl": "./",
6 | "module": "commonjs",
7 | "types": [
8 | "jasmine",
9 | "node"
10 | ]
11 | },
12 | "files": [
13 | "test.ts"
14 | ],
15 | "include": [
16 | "polyfills.ts",
17 | "**/*.spec.ts",
18 | "**/*.d.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.log(err));
13 |
--------------------------------------------------------------------------------
/src/app/contact/contact.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Contact
5 |
6 |
7 |
8 |
9 |
10 |
11 | Follow us on Twitter
12 |
13 |
14 | @ionicframework
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/app/public/auth/login/login.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | login
4 |
5 |
6 |
7 |
8 | Login
9 | Register
16 |
17 |
--------------------------------------------------------------------------------
/src/global.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/theming/
2 | @import "~@ionic/angular/css/core.css";
3 | @import "~@ionic/angular/css/normalize.css";
4 | @import "~@ionic/angular/css/structure.css";
5 | @import "~@ionic/angular/css/typography.css";
6 |
7 | @import "~@ionic/angular/css/padding.css";
8 | @import "~@ionic/angular/css/float-elements.css";
9 | @import "~@ionic/angular/css/text-alignment.css";
10 | @import "~@ionic/angular/css/text-transformation.css";
11 | @import "~@ionic/angular/css/flex-utils.css";
12 |
13 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 | import { AuthGuardService } from '../services/authGuard.service';
4 |
5 | const routes: Routes = [
6 | { path: '', canActivate: [AuthGuardService], loadChildren: './tabs/tabs.module#TabsPageModule' },
7 | { path: 'login', loadChildren: './public/auth/login/login.module#LoginPageModule' },
8 | ];
9 | @NgModule({
10 | imports: [RouterModule.forRoot(routes)],
11 | exports: [RouterModule]
12 | })
13 | export class AppRoutingModule { }
14 |
--------------------------------------------------------------------------------
/src/app/about/about.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from '@ionic/angular';
2 | import { RouterModule } from '@angular/router';
3 | import { NgModule } from '@angular/core';
4 | import { CommonModule } from '@angular/common';
5 | import { FormsModule } from '@angular/forms';
6 | import { AboutPage } from './about.page';
7 |
8 | @NgModule({
9 | imports: [
10 | IonicModule,
11 | CommonModule,
12 | FormsModule,
13 | RouterModule.forChild([{ path: '', component: AboutPage }])
14 | ],
15 | declarations: [AboutPage]
16 | })
17 | export class AboutPageModule {}
18 |
--------------------------------------------------------------------------------
/src/app/home/home.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { Router } from '@angular/router';
3 | import { AuthenticationService } from '../../services/authentication.service';
4 |
5 | @Component({
6 | selector: 'app-home',
7 | templateUrl: 'home.page.html',
8 | styleUrls: ['home.page.scss']
9 | })
10 | export class HomePage {
11 |
12 | constructor(private router: Router, private auth: AuthenticationService) { }
13 | logout() {
14 | this.auth.setLoggedIn(false)
15 | this.router.navigateByUrl("/login", { skipLocationChange: true });
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/app/contact/contact.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from '@ionic/angular';
2 | import { RouterModule } from '@angular/router';
3 | import { NgModule } from '@angular/core';
4 | import { CommonModule } from '@angular/common';
5 | import { FormsModule } from '@angular/forms';
6 | import { ContactPage } from './contact.page';
7 |
8 | @NgModule({
9 | imports: [
10 | IonicModule,
11 | CommonModule,
12 | FormsModule,
13 | RouterModule.forChild([{ path: '', component: ContactPage }])
14 | ],
15 | declarations: [ContactPage]
16 | })
17 | export class ContactPageModule {}
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Specifies intentionally untracked files to ignore when using Git
2 | # http://git-scm.com/docs/gitignore
3 |
4 | *~
5 | *.sw[mnpcod]
6 | *.log
7 | *.tmp
8 | *.tmp.*
9 | log.txt
10 | *.sublime-project
11 | *.sublime-workspace
12 | .vscode/
13 | npm-debug.log*
14 |
15 | .idea/
16 | .ionic/
17 | .sourcemaps/
18 | .sass-cache/
19 | .tmp/
20 | .versions/
21 | coverage/
22 | www/
23 | node_modules/
24 | tmp/
25 | temp/
26 | platforms/
27 | plugins/
28 | plugins/android.json
29 | plugins/ios.json
30 | $RECYCLE.BIN/
31 |
32 | .DS_Store
33 | Thumbs.db
34 | UserInterfaceState.xcuserstate
35 |
--------------------------------------------------------------------------------
/src/app/detail/detail.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { FormsModule } from '@angular/forms';
4 | import { Routes, RouterModule } from '@angular/router';
5 |
6 | import { IonicModule } from '@ionic/angular';
7 |
8 | import { DetailPage } from './detail.page';
9 |
10 | const routes: Routes = [
11 | {
12 | path: '',
13 | component: DetailPage
14 | }
15 | ];
16 |
17 | @NgModule({
18 | imports: [
19 | CommonModule,
20 | FormsModule,
21 | IonicModule,
22 | RouterModule.forChild(routes)
23 | ],
24 | declarations: [DetailPage]
25 | })
26 | export class DetailPageModule {}
27 |
--------------------------------------------------------------------------------
/src/app/public/auth/login/login.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { FormsModule } from '@angular/forms';
4 | import { Routes, RouterModule } from '@angular/router';
5 |
6 | import { IonicModule } from '@ionic/angular';
7 |
8 | import { LoginPage } from './login.page';
9 |
10 | const routes: Routes = [
11 | {
12 | path: '',
13 | component: LoginPage
14 | }
15 | ];
16 |
17 | @NgModule({
18 | imports: [
19 | CommonModule,
20 | FormsModule,
21 | IonicModule,
22 | RouterModule.forChild(routes)
23 | ],
24 | declarations: [LoginPage]
25 | })
26 | export class LoginPageModule {}
27 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/app/home/home.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from '@ionic/angular';
2 | import { RouterModule } from '@angular/router';
3 | import { NgModule } from '@angular/core';
4 | import { CommonModule } from '@angular/common';
5 | import { FormsModule } from '@angular/forms';
6 | import { HomePage } from './home.page';
7 | import { DetailPage } from '../detail/detail.page';
8 |
9 | @NgModule({
10 | imports: [
11 | IonicModule,
12 | CommonModule,
13 | FormsModule,
14 | RouterModule.forChild([
15 | { path: '', component: HomePage },
16 | { path: 'detail', loadChildren: '../detail/detail.module#DetailPageModule' },
17 | ])
18 | ],
19 | declarations: [HomePage]
20 | })
21 | export class HomePageModule {}
22 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { Platform } from '@ionic/angular';
4 | import { SplashScreen } from '@ionic-native/splash-screen/ngx';
5 | import { StatusBar } from '@ionic-native/status-bar/ngx';
6 |
7 | @Component({
8 | selector: 'app-root',
9 | templateUrl: 'app.component.html'
10 | })
11 | export class AppComponent {
12 | constructor(
13 | private platform: Platform,
14 | private splashScreen: SplashScreen,
15 | private statusBar: StatusBar
16 | ) {
17 | this.initializeApp();
18 | }
19 |
20 | initializeApp() {
21 | this.platform.ready().then(() => {
22 | this.statusBar.styleDefault();
23 | this.splashScreen.hide();
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/app/public/auth/login/login.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Router } from '@angular/router';
3 | import { AuthenticationService } from '../../../../services/authentication.service';
4 |
5 | @Component({
6 | selector: 'app-login',
7 | templateUrl: './login.page.html',
8 | styleUrls: ['./login.page.scss'],
9 | })
10 | export class LoginPage implements OnInit {
11 |
12 | constructor(private router: Router, private auth: AuthenticationService) { }
13 |
14 | ngOnInit() {
15 | }
16 |
17 | login() {
18 | this.auth.setLoggedIn(true)
19 | this.router.navigateByUrl("/", { skipLocationChange: true });
20 | }
21 |
22 | logout() {
23 | this.auth.setLoggedIn(false)
24 | this.router.navigateByUrl("/");
25 | }
26 |
27 |
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/app/home/home.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { HomePage } from './home.page';
5 |
6 | describe('HomePage', () => {
7 | let component: HomePage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [HomePage],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | }).compileComponents();
15 | }));
16 |
17 | beforeEach(() => {
18 | fixture = TestBed.createComponent(HomePage);
19 | component = fixture.componentInstance;
20 | fixture.detectChanges();
21 | });
22 |
23 | it('should create', () => {
24 | expect(component).toBeTruthy();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { TabsPage } from './tabs.page';
5 |
6 | describe('TabsPage', () => {
7 | let component: TabsPage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [TabsPage],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | }).compileComponents();
15 | }));
16 |
17 | beforeEach(() => {
18 | fixture = TestBed.createComponent(TabsPage);
19 | component = fixture.componentInstance;
20 | fixture.detectChanges();
21 | });
22 |
23 | it('should create', () => {
24 | expect(component).toBeTruthy();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/src/app/about/about.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { AboutPage } from './about.page';
5 |
6 | describe('AboutPage', () => {
7 | let component: AboutPage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [AboutPage],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | }).compileComponents();
15 | }));
16 |
17 | beforeEach(() => {
18 | fixture = TestBed.createComponent(AboutPage);
19 | component = fixture.componentInstance;
20 | fixture.detectChanges();
21 | });
22 |
23 | it('should create', () => {
24 | expect(component).toBeTruthy();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * In development mode, to ignore zone related error stack frames such as
11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
12 | * import the following file, but please comment it out in production mode
13 | * because it will have performance impact when throw error
14 | */
15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
16 |
--------------------------------------------------------------------------------
/src/app/contact/contact.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { ContactPage } from './contact.page';
5 |
6 | describe('ContactPage', () => {
7 | let component: ContactPage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [ContactPage],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | }).compileComponents();
15 | }));
16 |
17 | beforeEach(() => {
18 | fixture = TestBed.createComponent(ContactPage);
19 | component = fixture.componentInstance;
20 | fixture.detectChanges();
21 | });
22 |
23 | it('should create', () => {
24 | expect(component).toBeTruthy();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/src/app/detail/detail.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { DetailPage } from './detail.page';
5 |
6 | describe('DetailPage', () => {
7 | let component: DetailPage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [ DetailPage ],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | })
15 | .compileComponents();
16 | }));
17 |
18 | beforeEach(() => {
19 | fixture = TestBed.createComponent(DetailPage);
20 | component = fixture.componentInstance;
21 | fixture.detectChanges();
22 | });
23 |
24 | it('should create', () => {
25 | expect(component).toBeTruthy();
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/src/app/public/auth/login/login.page.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 |
4 | import { LoginPage } from './login.page';
5 |
6 | describe('LoginPage', () => {
7 | let component: LoginPage;
8 | let fixture: ComponentFixture;
9 |
10 | beforeEach(async(() => {
11 | TestBed.configureTestingModule({
12 | declarations: [ LoginPage ],
13 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
14 | })
15 | .compileComponents();
16 | }));
17 |
18 | beforeEach(() => {
19 | fixture = TestBed.createComponent(LoginPage);
20 | component = fixture.componentInstance;
21 | fixture.detectChanges();
22 | });
23 |
24 | it('should create', () => {
25 | expect(component).toBeTruthy();
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/src/services/authGuard.service.ts:
--------------------------------------------------------------------------------
1 |
2 | import { Injectable } from '@angular/core';
3 | import { CanActivate, ActivatedRoute, Router, UrlTree } from '@angular/router';
4 | import { AuthenticationService } from './authentication.service';
5 |
6 | @Injectable({
7 | providedIn: 'root'
8 | })
9 | export class AuthGuardService implements CanActivate {
10 |
11 | constructor(private auth: AuthenticationService, private router: Router) { }
12 |
13 | canActivate(): boolean | UrlTree {
14 | let value = this.auth.isAuthenticated()
15 | if (!value) {
16 | // initially was just redirecting here, but following the documention
17 | // I updated code to return a UrlTree
18 | // this.router.navigateByUrl("/login", { skipLocationChange: true })
19 |
20 | return this.router.parseUrl("/login");
21 | }
22 | return value
23 | }
24 | }
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule } from '@angular/platform-browser';
3 | import { RouterModule, RouteReuseStrategy } from '@angular/router';
4 |
5 | import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
6 | import { SplashScreen } from '@ionic-native/splash-screen/ngx';
7 | import { StatusBar } from '@ionic-native/status-bar/ngx';
8 |
9 | import { AppRoutingModule } from './app-routing.module';
10 | import { AppComponent } from './app.component';
11 |
12 | @NgModule({
13 | declarations: [AppComponent],
14 | entryComponents: [],
15 | imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
16 | providers: [
17 | StatusBar,
18 | SplashScreen,
19 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
20 | ],
21 | bootstrap: [AppComponent]
22 | })
23 | export class AppModule {}
24 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.module.ts:
--------------------------------------------------------------------------------
1 | import { IonicModule } from '@ionic/angular';
2 | import { RouterModule } from '@angular/router';
3 | import { NgModule } from '@angular/core';
4 | import { CommonModule } from '@angular/common';
5 | import { FormsModule } from '@angular/forms';
6 |
7 | import { TabsPageRoutingModule } from './tabs.router.module';
8 |
9 | import { TabsPage } from './tabs.page';
10 | import { ContactPageModule } from '../contact/contact.module';
11 | import { AboutPageModule } from '../about/about.module';
12 | import { HomePageModule } from '../home/home.module';
13 | import { DetailPageModule } from '../detail/detail.module';
14 |
15 | @NgModule({
16 | imports: [
17 | IonicModule,
18 | CommonModule,
19 | FormsModule,
20 | TabsPageRoutingModule,
21 | HomePageModule,
22 | AboutPageModule,
23 | ContactPageModule,
24 | DetailPageModule
25 | ],
26 | declarations: [TabsPage]
27 | })
28 | export class TabsPageModule {}
29 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.page.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, 'coverage'),
20 | reports: ['html', 'lcovonly'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
32 |
--------------------------------------------------------------------------------
/src/app/tabs/tabs.router.module.ts:
--------------------------------------------------------------------------------
1 | import { HomePageModule } from "./../home/home.module";
2 | import { NgModule } from "@angular/core";
3 | import { RouterModule, Routes } from "@angular/router";
4 |
5 | import { TabsPage } from "./tabs.page";
6 | import { HomePage } from "../home/home.page";
7 | import { AboutPage } from "../about/about.page";
8 | import { ContactPage } from "../contact/contact.page";
9 | import { DetailPage } from "../detail/detail.page";
10 |
11 | const routes: Routes = [
12 | {
13 | path: "tabs",
14 | component: TabsPage,
15 | children: [
16 | {
17 | path: "home",
18 | children: [
19 | {
20 | path: "",
21 | loadChildren: "./../home/home.module#HomePageModule"
22 | },
23 | {
24 | path: "detail",
25 | loadChildren: "./../detail/detail.module#DetailPageModule"
26 | }
27 | ]
28 | },
29 | {
30 | path: "about",
31 | children: [
32 | {
33 | path: "",
34 | loadChildren: "./../about/about.module#AboutPageModule"
35 | }
36 | ]
37 | },
38 | {
39 | path: "contact",
40 | children: [
41 | {
42 | path: "",
43 | loadChildren: "./../contact/contact.module#ContactPageModule"
44 | }
45 | ]
46 | }
47 | ]
48 | },
49 | {
50 | path: "",
51 | redirectTo: "/tabs/home",
52 | pathMatch: "full"
53 | }
54 | ];
55 |
56 | @NgModule({
57 | imports: [RouterModule.forChild(routes)],
58 | exports: [RouterModule]
59 | })
60 | export class TabsPageRoutingModule {}
61 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2 | import { TestBed, async } from '@angular/core/testing';
3 |
4 | import { Platform } from '@ionic/angular';
5 | import { SplashScreen } from '@ionic-native/splash-screen/ngx';
6 | import { StatusBar } from '@ionic-native/status-bar/ngx';
7 |
8 | import { AppComponent } from './app.component';
9 |
10 | describe('AppComponent', () => {
11 |
12 | let statusBarSpy, splashScreenSpy, platformReadySpy, platformSpy;
13 |
14 | beforeEach(async(() => {
15 | statusBarSpy = jasmine.createSpyObj('StatusBar', ['styleDefault']);
16 | splashScreenSpy = jasmine.createSpyObj('SplashScreen', ['hide']);
17 | platformReadySpy = Promise.resolve();
18 | platformSpy = jasmine.createSpyObj('Platform', { ready: platformReadySpy });
19 |
20 | TestBed.configureTestingModule({
21 | declarations: [AppComponent],
22 | schemas: [CUSTOM_ELEMENTS_SCHEMA],
23 | providers: [
24 | { provide: StatusBar, useValue: statusBarSpy },
25 | { provide: SplashScreen, useValue: splashScreenSpy },
26 | { provide: Platform, useValue: platformSpy },
27 | ],
28 | }).compileComponents();
29 | }));
30 |
31 | it('should create the app', () => {
32 | const fixture = TestBed.createComponent(AppComponent);
33 | const app = fixture.debugElement.componentInstance;
34 | expect(app).toBeTruthy();
35 | });
36 |
37 | it('should initialize the app', async () => {
38 | TestBed.createComponent(AppComponent);
39 | expect(platformSpy.ready).toHaveBeenCalled();
40 | await platformReadySpy;
41 | expect(statusBarSpy.styleDefault).toHaveBeenCalled();
42 | expect(splashScreenSpy.hide).toHaveBeenCalled();
43 | });
44 |
45 | // TODO: add more tests!
46 |
47 | });
48 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tabs-test",
3 | "version": "0.0.1",
4 | "author": "Ionic Framework",
5 | "homepage": "http://ionicframework.com/",
6 | "scripts": {
7 | "ng": "ng",
8 | "start": "ng serve",
9 | "build": "ng build",
10 | "test": "ng test",
11 | "lint": "ng lint",
12 | "e2e": "ng e2e"
13 | },
14 | "private": true,
15 | "dependencies": {
16 | "@angular/common": "^7.2.2",
17 | "@angular/core": "^7.2.2",
18 | "@angular/forms": "^7.2.2",
19 | "@angular/http": "^7.2.2",
20 | "@angular/platform-browser": "^7.2.2",
21 | "@angular/platform-browser-dynamic": "^7.2.2",
22 | "@angular/router": "^7.2.2",
23 | "@ionic-native/core": "^5.6.0",
24 | "@ionic-native/splash-screen": "^5.6.0",
25 | "@ionic-native/status-bar": "^5.6.0",
26 | "@ionic/angular": "^4.6.0",
27 | "core-js": "^2.6.9",
28 | "rxjs": "~6.5.1",
29 | "tslib": "^1.10.0",
30 | "zone.js": "~0.8.29"
31 | },
32 | "devDependencies": {
33 | "@angular-devkit/architect": "~0.13.8",
34 | "@angular-devkit/build-angular": "~0.13.8",
35 | "@angular-devkit/core": "~7.3.8",
36 | "@angular-devkit/schematics": "~7.3.8",
37 | "@angular/cli": "~7.3.8",
38 | "@angular/compiler": "~7.2.2",
39 | "@angular/compiler-cli": "~7.2.2",
40 | "@angular/language-service": "~7.2.2",
41 | "@ionic/angular-toolkit": "^1.5.1",
42 | "@types/jasmine": "^2.8.16",
43 | "@types/jasminewd2": "^2.0.6",
44 | "@types/node": "~12.0.0",
45 | "codelyzer": "~4.5.0",
46 | "jasmine-core": "~2.99.1",
47 | "jasmine-spec-reporter": "~4.2.1",
48 | "karma": "~4.1.0",
49 | "karma-chrome-launcher": "~2.2.0",
50 | "karma-coverage-istanbul-reporter": "^2.0.5",
51 | "karma-jasmine": "~1.1.2",
52 | "karma-jasmine-html-reporter": "^0.2.2",
53 | "protractor": "^5.4.2",
54 | "ts-node": "~8.1.0",
55 | "tslint": "~5.16.0",
56 | "typescript": "~3.1.6"
57 | },
58 | "description": "An Ionic project"
59 | }
60 |
--------------------------------------------------------------------------------
/src/theme/variables.scss:
--------------------------------------------------------------------------------
1 | // Ionic Variables and Theming. For more info, please see:
2 | // http://ionicframework.com/docs/theming/
3 |
4 | /** Ionic CSS Variables **/
5 | :root {
6 | /** primary **/
7 | --ion-color-primary: #488aff;
8 | --ion-color-primary-rgb: 72,138,255;
9 | --ion-color-primary-contrast: #fff;
10 | --ion-color-primary-contrast-rgb: 255,255,255;
11 | --ion-color-primary-shade: #3f79e0;
12 | --ion-color-primary-tint: #5a96ff;
13 |
14 | /** secondary **/
15 | --ion-color-secondary: #32db64;
16 | --ion-color-secondary-rgb: 50,219,100;
17 | --ion-color-secondary-contrast: #fff;
18 | --ion-color-secondary-contrast-rgb: 255,255,255;
19 | --ion-color-secondary-shade: #2cc158;
20 | --ion-color-secondary-tint: #47df74;
21 |
22 | /** tertiary **/
23 | --ion-color-tertiary: #f4a942;
24 | --ion-color-tertiary-rgb: 244,169,66;
25 | --ion-color-tertiary-contrast: #fff;
26 | --ion-color-tertiary-contrast-rgb: 255,255,255;
27 | --ion-color-tertiary-shade: #d7953a;
28 | --ion-color-tertiary-tint: #f5b255;
29 |
30 | /** success **/
31 | --ion-color-success: #10dc60;
32 | --ion-color-success-rgb: 16,220,96;
33 | --ion-color-success-contrast: #fff;
34 | --ion-color-success-contrast-rgb: 255,255,255;
35 | --ion-color-success-shade: #0ec254;
36 | --ion-color-success-tint: #28e070;
37 |
38 | /** warning **/
39 | --ion-color-warning: #ffce00;
40 | --ion-color-warning-rgb: 255,206,0;
41 | --ion-color-warning-contrast: #000;
42 | --ion-color-warning-contrast-rgb: 0,0,0;
43 | --ion-color-warning-shade: #e0b500;
44 | --ion-color-warning-tint: #ffd31a;
45 |
46 | /** danger **/
47 | --ion-color-danger: #f53d3d;
48 | --ion-color-danger-rgb: 245,61,61;
49 | --ion-color-danger-contrast: #fff;
50 | --ion-color-danger-contrast-rgb: 255,255,255;
51 | --ion-color-danger-shade: #d83636;
52 | --ion-color-danger-tint: #f65050;
53 |
54 | /** light **/
55 | --ion-color-light: #f4f4f4;
56 | --ion-color-light-rgb: 244,244,244;
57 | --ion-color-light-contrast: #000;
58 | --ion-color-light-contrast-rgb: 0,0,0;
59 | --ion-color-light-shade: #d7d7d7;
60 | --ion-color-light-tint: #f5f5f5;
61 |
62 | /** medium **/
63 | --ion-color-medium: #989aa2;
64 | --ion-color-medium-rgb: 152,154,162;
65 | --ion-color-medium-contrast: #000;
66 | --ion-color-medium-contrast-rgb: 0,0,0;
67 | --ion-color-medium-shade: #86888f;
68 | --ion-color-medium-tint: #a2a4ab;
69 |
70 | /** dark **/
71 | --ion-color-dark: #222;
72 | --ion-color-dark-rgb: 34,34,34;
73 | --ion-color-dark-contrast: #fff;
74 | --ion-color-dark-contrast-rgb: 255,255,255;
75 | --ion-color-dark-shade: #1e1e1e;
76 | --ion-color-dark-tint: #383838;
77 | }
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/
22 | // import 'core-js/es6/symbol';
23 | // import 'core-js/es6/object';
24 | // import 'core-js/es6/function';
25 | // import 'core-js/es6/parse-int';
26 | // import 'core-js/es6/parse-float';
27 | // import 'core-js/es6/number';
28 | // import 'core-js/es6/math';
29 | // import 'core-js/es6/string';
30 | // import 'core-js/es6/date';
31 | // import 'core-js/es6/array';
32 | // import 'core-js/es6/regexp';
33 | // import 'core-js/es6/map';
34 | // import 'core-js/es6/weak-map';
35 | // import 'core-js/es6/set';
36 |
37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
38 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
39 |
40 | /** IE10 and IE11 requires the following for the Reflect API. */
41 | // import 'core-js/es6/reflect';
42 |
43 |
44 | /** Evergreen browsers require these. **/
45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46 | import 'core-js/es7/reflect';
47 |
48 |
49 | /**
50 | * Required to support Web Animations `@angular/platform-browser/animations`.
51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
52 | **/
53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54 |
55 |
56 |
57 | /***************************************************************************************************
58 | * Zone JS is required by Angular itself.
59 | */
60 | import 'zone.js/dist/zone'; // Included with Angular CLI.
61 |
62 |
63 |
64 | /***************************************************************************************************
65 | * APPLICATION IMPORTS
66 | */
67 |
68 | /**
69 | * Date, currency, decimal and percent pipes.
70 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
71 | */
72 | // import 'intl'; // Run `npm install --save intl`.
73 | /**
74 | * Need to import at least one locale-data with intl.
75 | */
76 | // import 'intl/locale-data/jsonp/en';
77 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "arrow-return-shorthand": true,
7 | "callable-types": true,
8 | "class-name": true,
9 | "comment-format": [
10 | true,
11 | "check-space"
12 | ],
13 | "curly": true,
14 | "deprecation": {
15 | "severity": "warn"
16 | },
17 | "eofline": true,
18 | "forin": true,
19 | "import-spacing": true,
20 | "indent": [
21 | true,
22 | "spaces"
23 | ],
24 | "interface-over-type-literal": true,
25 | "label-position": true,
26 | "max-line-length": [
27 | true,
28 | 140
29 | ],
30 | "member-access": false,
31 | "member-ordering": [
32 | true,
33 | {
34 | "order": [
35 | "static-field",
36 | "instance-field",
37 | "static-method",
38 | "instance-method"
39 | ]
40 | }
41 | ],
42 | "no-arg": true,
43 | "no-bitwise": true,
44 | "no-console": [
45 | true,
46 | "debug",
47 | "info",
48 | "time",
49 | "timeEnd",
50 | "trace"
51 | ],
52 | "no-construct": true,
53 | "no-debugger": true,
54 | "no-duplicate-super": true,
55 | "no-empty": false,
56 | "no-empty-interface": true,
57 | "no-eval": true,
58 | "no-inferrable-types": [
59 | true,
60 | "ignore-params"
61 | ],
62 | "no-misused-new": true,
63 | "no-non-null-assertion": true,
64 | "no-shadowed-variable": true,
65 | "no-string-literal": false,
66 | "no-string-throw": true,
67 | "no-switch-case-fall-through": true,
68 | "no-trailing-whitespace": true,
69 | "no-unnecessary-initializer": true,
70 | "no-unused-expression": true,
71 | "no-use-before-declare": true,
72 | "no-var-keyword": true,
73 | "object-literal-sort-keys": false,
74 | "one-line": [
75 | true,
76 | "check-open-brace",
77 | "check-catch",
78 | "check-else",
79 | "check-whitespace"
80 | ],
81 | "prefer-const": true,
82 | "quotemark": [
83 | true,
84 | "single"
85 | ],
86 | "radix": true,
87 | "semicolon": [
88 | true,
89 | "always"
90 | ],
91 | "triple-equals": [
92 | true,
93 | "allow-null-check"
94 | ],
95 | "typedef-whitespace": [
96 | true,
97 | {
98 | "call-signature": "nospace",
99 | "index-signature": "nospace",
100 | "parameter": "nospace",
101 | "property-declaration": "nospace",
102 | "variable-declaration": "nospace"
103 | }
104 | ],
105 | "unified-signatures": true,
106 | "variable-name": false,
107 | "whitespace": [
108 | true,
109 | "check-branch",
110 | "check-decl",
111 | "check-operator",
112 | "check-separator",
113 | "check-type"
114 | ],
115 | "directive-selector": [
116 | true,
117 | "attribute",
118 | "app",
119 | "camelCase"
120 | ],
121 | "component-selector": [
122 | true,
123 | "element",
124 | "app",
125 | "page",
126 | "kebab-case"
127 | ],
128 | "no-output-on-prefix": true,
129 | "use-input-property-decorator": true,
130 | "use-output-property-decorator": true,
131 | "use-host-property-decorator": true,
132 | "no-input-rename": true,
133 | "no-output-rename": true,
134 | "use-life-cycle-interface": true,
135 | "use-pipe-transform-interface": true,
136 | "directive-class-suffix": true
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
3 | "version": 1,
4 | "defaultProject": "app",
5 | "newProjectRoot": "projects",
6 | "projects": {
7 | "app": {
8 | "root": "",
9 | "sourceRoot": "src",
10 | "projectType": "application",
11 | "prefix": "app",
12 | "schematics": {},
13 | "architect": {
14 | "build": {
15 | "builder": "@angular-devkit/build-angular:browser",
16 | "options": {
17 | "outputPath": "www",
18 | "index": "src/index.html",
19 | "main": "src/main.ts",
20 | "polyfills": "src/polyfills.ts",
21 | "tsConfig": "src/tsconfig.app.json",
22 | "assets": [
23 | {
24 | "glob": "**/*",
25 | "input": "src/assets",
26 | "output": "assets"
27 | },
28 | {
29 | "glob": "**/*.svg",
30 | "input": "node_modules/ionicons/dist/ionicons/svg",
31 | "output": "./svg"
32 | }
33 | ],
34 | "styles": [
35 | {
36 | "input": "src/theme/variables.scss"
37 | },
38 | {
39 | "input": "src/global.scss"
40 | },
41 | {
42 | "input": "src/app/app.scss"
43 | }
44 | ],
45 | "scripts": [],
46 | "es5BrowserSupport": true
47 | },
48 | "configurations": {
49 | "production": {
50 | "fileReplacements": [
51 | {
52 | "replace": "src/environments/environment.ts",
53 | "with": "src/environments/environment.prod.ts"
54 | }
55 | ],
56 | "optimization": true,
57 | "outputHashing": "all",
58 | "sourceMap": false,
59 | "extractCss": true,
60 | "namedChunks": false,
61 | "aot": true,
62 | "extractLicenses": true,
63 | "vendorChunk": false,
64 | "buildOptimizer": true,
65 | "budgets": [
66 | {
67 | "type": "initial",
68 | "maximumWarning": "2mb",
69 | "maximumError": "5mb"
70 | }
71 | ]
72 | },
73 | "ci": {
74 | "progress": false
75 | }
76 | }
77 | },
78 | "serve": {
79 | "builder": "@angular-devkit/build-angular:dev-server",
80 | "options": {
81 | "browserTarget": "app:build"
82 | },
83 | "configurations": {
84 | "production": {
85 | "browserTarget": "app:build:production"
86 | },
87 | "ci": {
88 | "progress": false
89 | }
90 | }
91 | },
92 | "extract-i18n": {
93 | "builder": "@angular-devkit/build-angular:extract-i18n",
94 | "options": {
95 | "browserTarget": "app:build"
96 | }
97 | },
98 | "test": {
99 | "builder": "@angular-devkit/build-angular:karma",
100 | "options": {
101 | "main": "src/test.ts",
102 | "polyfills": "src/polyfills.ts",
103 | "tsConfig": "src/tsconfig.spec.json",
104 | "karmaConfig": "src/karma.conf.js",
105 | "styles": [],
106 | "scripts": [],
107 | "assets": [
108 | {
109 | "glob": "favicon.ico",
110 | "input": "src/",
111 | "output": "/"
112 | },
113 | {
114 | "glob": "**/*",
115 | "input": "src/assets",
116 | "output": "/assets"
117 | }
118 | ]
119 | },
120 | "configurations": {
121 | "ci": {
122 | "progress": false,
123 | "watch": false
124 | }
125 | }
126 | },
127 | "lint": {
128 | "builder": "@angular-devkit/build-angular:tslint",
129 | "options": {
130 | "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"],
131 | "exclude": ["**/node_modules/**"]
132 | }
133 | },
134 | "ionic-cordova-build": {
135 | "builder": "@ionic/angular-toolkit:cordova-build",
136 | "options": {
137 | "browserTarget": "app:build"
138 | },
139 | "configurations": {
140 | "production": {
141 | "browserTarget": "app:build:production"
142 | }
143 | }
144 | },
145 | "ionic-cordova-serve": {
146 | "builder": "@ionic/angular-toolkit:cordova-serve",
147 | "options": {
148 | "cordovaBuildTarget": "app:ionic-cordova-build",
149 | "devServerTarget": "app:serve"
150 | },
151 | "configurations": {
152 | "production": {
153 | "cordovaBuildTarget": "app:ionic-cordova-build:production",
154 | "devServerTarget": "app:serve:production"
155 | }
156 | }
157 | }
158 | }
159 | },
160 | "app-e2e": {
161 | "root": "e2e/",
162 | "projectType": "application",
163 | "architect": {
164 | "e2e": {
165 | "builder": "@angular-devkit/build-angular:protractor",
166 | "options": {
167 | "protractorConfig": "e2e/protractor.conf.js",
168 | "devServerTarget": "app:serve"
169 | },
170 | "configurations": {
171 | "production": {
172 | "devServerTarget": "app:serve:production"
173 | },
174 | "ci": {
175 | "devServerTarget": "app:serve:ci"
176 | }
177 | }
178 | },
179 | "lint": {
180 | "builder": "@angular-devkit/build-angular:tslint",
181 | "options": {
182 | "tsConfig": "e2e/tsconfig.e2e.json",
183 | "exclude": ["**/node_modules/**"]
184 | }
185 | }
186 | }
187 | }
188 | },
189 | "cli": {
190 | "defaultCollection": "@ionic/angular-toolkit"
191 | },
192 | "schematics": {
193 | "@ionic/angular-toolkit:component": {
194 | "styleext": "scss"
195 | },
196 | "@ionic/angular-toolkit:page": {
197 | "styleext": "scss"
198 | }
199 | }
200 | }
201 |
--------------------------------------------------------------------------------