├── src
├── app
│ ├── pages
│ │ ├── home
│ │ │ ├── home.page.scss
│ │ │ ├── home.page.html
│ │ │ ├── home.module.ts
│ │ │ ├── home.page.spec.ts
│ │ │ └── home.page.ts
│ │ ├── tabs
│ │ │ ├── tabs.page.scss
│ │ │ ├── tabs.page.ts
│ │ │ ├── tabs.page.html
│ │ │ ├── tabs.page.spec.ts
│ │ │ ├── tabs.module.ts
│ │ │ └── tabs.router.module.ts
│ │ ├── contact
│ │ │ ├── contact.page.scss
│ │ │ ├── contact.page.ts
│ │ │ ├── contact.page.html
│ │ │ ├── contact.module.ts
│ │ │ └── contact.page.spec.ts
│ │ └── list
│ │ │ ├── list.page.scss
│ │ │ ├── list.module.ts
│ │ │ ├── list.item.modal.html
│ │ │ ├── list.page.html
│ │ │ ├── list.item.modal.ts
│ │ │ └── list.page.ts
│ ├── app.component.html
│ ├── app-routing.module.ts
│ ├── components
│ │ └── components.module.ts
│ ├── classes
│ │ └── item.class.ts
│ ├── services
│ │ └── auth-route-guard.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ └── app.component.spec.ts
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── assets
│ ├── icon
│ │ └── favicon.png
│ └── service-worker.js
├── tsconfig.app.json
├── tsconfig.spec.json
├── main.ts
├── test.ts
├── global.scss
├── index.html
├── karma.conf.js
├── theme
│ └── variables.scss
└── polyfills.ts
├── resources
├── icon.png
├── splash.png
├── ios
│ ├── icon
│ │ ├── icon.png
│ │ ├── icon-40.png
│ │ ├── icon-50.png
│ │ ├── icon-60.png
│ │ ├── icon-72.png
│ │ ├── icon-76.png
│ │ ├── icon@2x.png
│ │ ├── icon-1024.png
│ │ ├── icon-40@2x.png
│ │ ├── icon-40@3x.png
│ │ ├── icon-50@2x.png
│ │ ├── icon-60@2x.png
│ │ ├── icon-60@3x.png
│ │ ├── icon-72@2x.png
│ │ ├── icon-76@2x.png
│ │ ├── icon-small.png
│ │ ├── icon-83.5@2x.png
│ │ ├── icon-small@2x.png
│ │ └── icon-small@3x.png
│ └── splash
│ │ ├── Default-667h.png
│ │ ├── Default-736h.png
│ │ ├── Default~iphone.png
│ │ ├── Default@2x~iphone.png
│ │ ├── Default-Portrait~ipad.png
│ │ ├── Default-568h@2x~iphone.png
│ │ ├── Default-Landscape-736h.png
│ │ ├── Default-Landscape~ipad.png
│ │ ├── Default-Landscape@2x~ipad.png
│ │ ├── Default-Landscape@~ipadpro.png
│ │ ├── Default-Portrait@2x~ipad.png
│ │ ├── Default-Portrait@~ipadpro.png
│ │ └── Default@2x~universal~anyany.png
├── android
│ ├── icon
│ │ ├── drawable-hdpi-icon.png
│ │ ├── drawable-ldpi-icon.png
│ │ ├── drawable-mdpi-icon.png
│ │ ├── drawable-xhdpi-icon.png
│ │ ├── drawable-xxhdpi-icon.png
│ │ └── drawable-xxxhdpi-icon.png
│ └── splash
│ │ ├── drawable-land-hdpi-screen.png
│ │ ├── drawable-land-ldpi-screen.png
│ │ ├── drawable-land-mdpi-screen.png
│ │ ├── drawable-land-xhdpi-screen.png
│ │ ├── drawable-land-xxhdpi-screen.png
│ │ ├── drawable-port-hdpi-screen.png
│ │ ├── drawable-port-ldpi-screen.png
│ │ ├── drawable-port-mdpi-screen.png
│ │ ├── drawable-port-xhdpi-screen.png
│ │ ├── drawable-port-xxhdpi-screen.png
│ │ ├── drawable-land-xxxhdpi-screen.png
│ │ └── drawable-port-xxxhdpi-screen.png
└── README.md
├── ionic.config.json
├── e2e
├── tsconfig.e2e.json
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
└── protractor.conf.js
├── tsconfig.json
├── .gitignore
├── README.md
├── package.json
├── tslint.json
├── angular.json
├── config.xml
└── LICENSE.md
/src/app/pages/home/home.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/pages/tabs/tabs.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/pages/contact/contact.page.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/icon.png
--------------------------------------------------------------------------------
/resources/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/splash.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon.png
--------------------------------------------------------------------------------
/src/assets/icon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/src/assets/icon/favicon.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-40.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-50.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-60.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-72.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-76.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-1024.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-40@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-40@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-50@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-60@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-60@3x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-72@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-76@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-small.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-83.5@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-small@2x.png
--------------------------------------------------------------------------------
/resources/ios/icon/icon-small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/icon/icon-small@3x.png
--------------------------------------------------------------------------------
/ionic.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "amplify-ionic-sample-app",
3 | "type": "angular",
4 | "integrations": {
5 | "cordova": {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/resources/ios/splash/Default-667h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-667h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default~iphone.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default@2x~iphone.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-hdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-hdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-ldpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-ldpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-mdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-mdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-xhdpi-icon.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Portrait~ipad.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-xxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/android/icon/drawable-xxxhdpi-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/icon/drawable-xxxhdpi-icon.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-568h@2x~iphone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-568h@2x~iphone.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape-736h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Landscape-736h.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Landscape~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Landscape@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Landscape@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Landscape@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Portrait@2x~ipad.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default-Portrait@~ipadpro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default-Portrait@~ipadpro.png
--------------------------------------------------------------------------------
/resources/ios/splash/Default@2x~universal~anyany.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/ios/splash/Default@2x~universal~anyany.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-hdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-hdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-ldpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-ldpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-mdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-mdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-xhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-xxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-land-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-land-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/resources/android/splash/drawable-port-xxxhdpi-screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-amplify-ionic-sample/HEAD/resources/android/splash/drawable-port-xxxhdpi-screen.png
--------------------------------------------------------------------------------
/src/app/pages/list/list.page.scss:
--------------------------------------------------------------------------------
1 | .hover {
2 | cursor: pointer;
3 | }
4 | .complete {
5 | color: green;
6 | }
7 | .card-title {
8 | margin: 12px 0 0 12px !important;
9 | }
10 |
--------------------------------------------------------------------------------
/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/pages/tabs/tabs.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-page-tabs',
5 | templateUrl: 'tabs.page.html',
6 | styleUrls: ['tabs.page.scss']
7 | })
8 | export class TabsPage {}
9 |
--------------------------------------------------------------------------------
/src/app/pages/contact/contact.page.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-page-contact',
5 | templateUrl: 'contact.page.html',
6 | styleUrls: ['contact.page.scss']
7 | })
8 | export class ContactPage {}
9 |
--------------------------------------------------------------------------------
/src/app/pages/home/home.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Login
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/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.css('app-root ion-content')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "baseUrl": "./",
6 | "module": "es2015",
7 | "types" : ["node"]
8 | },
9 | "exclude": [
10 | "test.ts",
11 | "**/*.spec.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 |
4 | const routes: Routes = [
5 | { path: '', loadChildren: './pages/tabs/tabs.module#TabsPageModule' }
6 | ];
7 | @NgModule({
8 | imports: [RouterModule.forRoot(routes)],
9 | exports: [RouterModule]
10 | })
11 | export class AppRoutingModule {}
12 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 | "types" : ["node"]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/app/pages/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 |
--------------------------------------------------------------------------------
/resources/README.md:
--------------------------------------------------------------------------------
1 | These are Cordova resources. You can replace icon.png and splash.png and run
2 | `ionic cordova resources` to generate custom icons and splash screens for your
3 | app. See `ionic cordova resources --help` for details.
4 |
5 | Cordova reference documentation:
6 |
7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/
9 |
--------------------------------------------------------------------------------
/src/app/components/components.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { FormsModule } from '@angular/forms';
4 | import { IonicModule } from '@ionic/angular';
5 |
6 |
7 | @NgModule({
8 | imports: [
9 | CommonModule,
10 | FormsModule,
11 | IonicModule.forRoot(),
12 | ],
13 | declarations: [],
14 | entryComponents: []
15 | })
16 | export class ComponentsModule {}
17 |
--------------------------------------------------------------------------------
/src/app/pages/tabs/tabs.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/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 | import Amplify, { Analytics } from 'aws-amplify';
8 | import aws_exports from './aws-exports';
9 |
10 | Amplify.configure(aws_exports);
11 |
12 | if (environment.production) {
13 | enableProdMode();
14 | }
15 |
16 | platformBrowserDynamic().bootstrapModule(AppModule)
17 | .catch(err => console.log(err));
18 |
--------------------------------------------------------------------------------
/src/app/classes/item.class.ts:
--------------------------------------------------------------------------------
1 | import { v4 as uuid } from 'uuid';
2 |
3 | export class ToDoList {
4 | userId: any;
5 | items: Array
6 |
7 | constructor(params){
8 | this.items = params.items || [];
9 | this.userId = params.userId;
10 | }
11 | }
12 |
13 | export class ToDoItem {
14 | id: string;
15 | title: string;
16 | description: string;
17 | status: any;
18 |
19 | constructor(params){
20 | this.id = uuid();
21 | this.title = params.title;
22 | this.description = params.description;
23 | this.status = 'new';
24 | }
25 | }
--------------------------------------------------------------------------------
/src/app/pages/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 |
--------------------------------------------------------------------------------
/src/app/pages/list/list.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { CommonModule } from '@angular/common';
3 | import { FormsModule } from '@angular/forms';
4 | import { IonicModule } from '@ionic/angular';
5 | import { ListPage } from './list.page';
6 | import { ListItemModal } from './list.item.modal';
7 |
8 | @NgModule({
9 | imports: [
10 | CommonModule,
11 | IonicModule.forRoot(),
12 | FormsModule
13 | ],
14 | declarations: [
15 | ListPage,
16 | ListItemModal
17 | ],
18 | entryComponents: [
19 | ListItemModal
20 | ],
21 | providers: []
22 | })
23 | export class ListModule {}
24 |
--------------------------------------------------------------------------------
/src/app/services/auth-route-guard.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { Router, CanActivate } from '@angular/router';
3 | import { Events } from '@ionic/angular'
4 |
5 | @Injectable()
6 | export class AuthGuardService implements CanActivate {
7 |
8 | signedIn: boolean = false;
9 |
10 | constructor(public router: Router, public events: Events) {
11 | this.events.subscribe('data:AuthState', async (data) => {
12 | if (data.loggedIn){
13 | this.signedIn = true;
14 | } else {
15 | this.signedIn =false
16 | }
17 | })
18 | }
19 |
20 | canActivate() {
21 | return this.signedIn;
22 | }
23 | }
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { Platform } from '@ionic/angular';
4 |
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 | registration: any;
13 | constructor(
14 | private platform: Platform,
15 | // private splashScreen: SplashScreen,
16 | private statusBar: StatusBar
17 | ) {
18 | this.initializeApp();
19 | }
20 |
21 | async initializeApp() {
22 | this.platform.ready().then(async() => {
23 | this.statusBar.styleDefault();
24 | });
25 | }
26 | }
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/pages/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 { AmplifyAngularModule, AmplifyIonicModule, AmplifyService } from 'aws-amplify-angular'
8 |
9 |
10 | @NgModule({
11 | imports: [
12 | IonicModule,
13 | CommonModule,
14 | FormsModule,
15 | AmplifyAngularModule,
16 | AmplifyIonicModule,
17 | RouterModule.forChild([{ path: '', component: HomePage }])
18 | ],
19 | declarations: [HomePage],
20 | providers: [AmplifyService]
21 | })
22 | export class HomePageModule {}
23 |
--------------------------------------------------------------------------------
/.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 | .sourcemaps/
17 | .sass-cache/
18 | .tmp/
19 | .versions/
20 | coverage/
21 | www/
22 | node_modules/
23 | tmp/
24 | temp/
25 | platforms/
26 | plugins/
27 | plugins/android.json
28 | plugins/ios.json
29 | $RECYCLE.BIN/
30 |
31 | .DS_Store
32 | Thumbs.db
33 | UserInterfaceState.xcuserstate
34 |
35 | #awsmobilejs
36 | appsync-info.json
37 | aws-info.json
38 | project-info.json
39 | aws-exports.*
40 | awsmobilejs/.awsmobile/backend-build
41 | awsmobilejs/\#current-backend-info
42 | ~awsmobilejs-*/
--------------------------------------------------------------------------------
/src/app/pages/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/pages/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/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { BrowserModule } from '@angular/platform-browser';
3 | import { RouterModule, RouteReuseStrategy } from '@angular/router';
4 | import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
5 | import { StatusBar } from '@ionic-native/status-bar/ngx';
6 | import { AppRoutingModule } from './app-routing.module';
7 | import { AppComponent } from './app.component';
8 |
9 |
10 | @NgModule({
11 | declarations: [AppComponent],
12 | entryComponents: [],
13 | imports: [
14 | BrowserModule,
15 | IonicModule.forRoot(),
16 | AppRoutingModule
17 | ],
18 | providers: [
19 | StatusBar,
20 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
21 | ],
22 | bootstrap: [AppComponent]
23 | })
24 | export class AppModule {}
25 |
--------------------------------------------------------------------------------
/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/pages/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/pages/list/list.item.modal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{editItem ? 'Edit' : 'Create'}} Item
4 |
5 |
6 |
7 |
8 |
9 | ToDo Title
10 |
11 |
12 |
13 | ToDo Description
14 |
15 |
16 |
17 |
18 |
19 | Save
20 | Cancel
21 |
--------------------------------------------------------------------------------
/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/global.scss:
--------------------------------------------------------------------------------
1 | // http://ionicframework.com/docs/theming/
2 |
3 |
4 | // App Global Sass
5 | // ----------------------------------------------------------------------------
6 | // Put style rules here that you want to apply globally. These styles are for
7 | // the entire app and not just one component. Additionally, this file can be
8 | // also used as an entry point to import other Sass files to be included in the
9 | // output CSS.
10 | //
11 | // Shared Sass variables, which can be used to adjust Ionic's default Sass
12 | // variables, belong in "theme/variables.scss".
13 | //
14 | // To declare rules for a specific mode, create a child rule for the .md, .ios,
15 | // or .wp mode classes. The mode class is automatically applied to the
16 | // element in the app.
17 | @import "./node_modules/aws-amplify-angular/theme.scss";
18 | @import "./src/app/pages/list/list.page.scss";
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ionic App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/app/pages/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 { ListModule } from '../list/list.module';
12 | import { HomePageModule } from '../home/home.module';
13 |
14 | import { AuthGuardService } from '../../services/auth-route-guard'
15 |
16 | @NgModule({
17 | imports: [
18 | IonicModule,
19 | CommonModule,
20 | FormsModule,
21 | TabsPageRoutingModule,
22 | HomePageModule,
23 | ListModule,
24 | ContactPageModule
25 | ],
26 | declarations: [TabsPage],
27 | providers: [AuthGuardService]
28 | })
29 | export class TabsPageModule {}
30 |
--------------------------------------------------------------------------------
/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/pages/list/list.page.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{user.username + '\'s list' }}
5 |
6 |
7 | Add Item
8 |
9 |
10 |
11 |
12 |
13 | {{item.title}}
14 | {{item.description}}
15 |
16 |
17 |
18 | Delete
19 |
20 | Mark Complete
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/app/pages/tabs/tabs.router.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule, Routes, CanActivate } from '@angular/router';
3 |
4 | import { TabsPage } from './tabs.page';
5 | import { HomePage } from '../home/home.page';
6 | import { ListPage } from '../list/list.page';
7 | import { ContactPage } from '../contact/contact.page';
8 | import { AuthGuardService } from '../../services/auth-route-guard'
9 |
10 | const routes: Routes = [
11 | {
12 | path: 'tabs',
13 | component: TabsPage,
14 | children: [
15 | {
16 | path: 'home',
17 | outlet: 'home',
18 | component: HomePage
19 | },
20 | {
21 | path: 'list',
22 | outlet: 'list',
23 | component: ListPage,
24 | canActivate: [AuthGuardService]
25 | },
26 | {
27 | path: 'contact',
28 | outlet: 'contact',
29 | component: ContactPage
30 | }
31 | ]
32 | },
33 | {
34 | path: '',
35 | redirectTo: '/tabs/(home:home)',
36 | pathMatch: 'full'
37 | }
38 | ];
39 |
40 | @NgModule({
41 | imports: [RouterModule.forChild(routes)],
42 | exports: [RouterModule]
43 | })
44 | export class TabsPageRoutingModule {}
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AWS Amplify Ionic Sample
2 |
3 | This is a sample application has been archived in favor of [Amplify JS Samples](https://github.com/aws-amplify/amplify-js-samples). While the archived repository will still work, please go +1 this [feature request for Ionic sample](https://github.com/aws-amplify/amplify-js-samples/issues/13) if you are looking to use this sample.
4 |
5 | ## Getting Started
6 |
7 | The branches of this project correspond to tutorials that walk you through the development of this application.
8 |
9 | The following instructions are meant to be used with the master branch, which is the final version of the app.
10 |
11 | Install the Ionic 4 CLI:
12 | ```
13 | npm i -g ionic@rc
14 | ```
15 |
16 | Create the Ionic 4 starter project:
17 | ```
18 | ionic start tabs --type=angular
19 | ```
20 |
21 | Install the AWS Mobile CLI (if you haven't already):
22 | ```
23 | $ npm install -g @aws-amplify/cli
24 | $ amplify configure
25 | ```
26 |
27 | ### Prerequisites
28 |
29 | In addition to the setup listed above, this app will require a modern version of NodeJS.
30 |
31 | ## License
32 |
33 | This project is licensed under the Apache License - see the [LICENSE.md](LICENSE.md) file for details
34 |
--------------------------------------------------------------------------------
/src/app/pages/home/home.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, AfterContentInit } from '@angular/core';
2 | import { Events } from '@ionic/angular';
3 | import { AuthGuardService } from '../../services/auth-route-guard'
4 | import { AmplifyService } from 'aws-amplify-angular';
5 |
6 |
7 | @Component({
8 | selector: 'app-page-home',
9 | templateUrl: 'home.page.html',
10 | styleUrls: ['home.page.scss']
11 | })
12 | export class HomePage implements AfterContentInit{
13 |
14 | authState: any;
15 | // including AuthGuardService here so that it's available to listen to auth events
16 | authService: AuthGuardService
17 | amplifyService: AmplifyService
18 |
19 | constructor(
20 | public events: Events,
21 | public guard: AuthGuardService,
22 | public amplify: AmplifyService
23 | ) {
24 | this.authState = {loggedIn: false};
25 | this.authService = guard;
26 | this.amplifyService = amplify;
27 | this.amplifyService.authStateChange$
28 | .subscribe(authState => {
29 | this.authState.loggedIn = authState.state === 'signedIn';
30 | this.events.publish('data:AuthState', this.authState)
31 | });
32 | }
33 |
34 | ngAfterContentInit(){
35 | this.events.publish('data:AuthState', this.authState)
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/app/pages/list/list.item.modal.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ModalController } from '@ionic/angular';
3 | import { ToDoItem, ToDoList } from '../../classes/item.class';
4 |
5 | @Component({
6 | selector: 'item-modal',
7 | templateUrl: 'list.item.modal.html',
8 | })
9 | export class ListItemModal implements OnInit {
10 |
11 | itemList: ToDoList;
12 | editItem: ToDoItem;
13 | user: string;
14 | item: ToDoItem;
15 |
16 |
17 |
18 | constructor(private modalController: ModalController) {}
19 |
20 | ngOnInit(){
21 | /*
22 | If we pass in an 'editItem' property, then we create a copy to store changes to the existing item
23 | so that the original is not modified unless the user saves.
24 | */
25 | this.item = this.editItem ? Object.assign({}, this.editItem) : new ToDoItem({})
26 | }
27 |
28 |
29 | save() {
30 | this.modalController.dismiss({
31 | itemList: this.itemList,
32 | /*
33 | We pass back either a newItem or editItem value depending on whether an edit operation is taking place
34 | so that the list module can decide whether to insert into the items array or splice into it.
35 | */
36 | newItem: !this.editItem ? this.item : null,
37 | editItem: this.editItem ? this.item : null
38 | });
39 | };
40 |
41 | cancel(){
42 | this.modalController.dismiss({itemList: this.itemList})
43 | }
44 | }
--------------------------------------------------------------------------------
/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', async () => {
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 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "amplify-ionic-sample-app",
3 | "version": "0.0.1",
4 | "author": "Ionic Framework",
5 | "homepage": "http://ionicframework.com/",
6 | "scripts": {
7 | "ng": "ng",
8 | "start": "ionic serve",
9 | "build": "ionic build",
10 | "test": "ng test",
11 | "lint": "ng lint",
12 | "e2e": "ng e2e"
13 | },
14 | "private": true,
15 | "dependencies": {
16 | "@angular/common": "6.0.4",
17 | "@angular/core": "6.0.4",
18 | "@angular/forms": "6.0.4",
19 | "@angular/http": "6.0.4",
20 | "@angular/platform-browser": "6.0.4",
21 | "@angular/platform-browser-dynamic": "6.0.4",
22 | "@angular/router": "6.0.4",
23 | "@ionic-native/core": "5.0.0-beta.10",
24 | "@ionic-native/splash-screen": "5.0.0-beta.10",
25 | "@ionic-native/status-bar": "5.0.0-beta.10",
26 | "@ionic/angular": "4.0.0-alpha.7",
27 | "@ionic/schematics-angular": "latest",
28 | "amazon-cognito-identity-js": "^2.0.2",
29 | "aws-amplify": "^1.0.0",
30 | "aws-amplify-angular": "^1.0.0",
31 | "cordova-android": "7.0.0",
32 | "cordova-ios": "4.5.4",
33 | "cordova-plugin-device": "^2.0.2",
34 | "cordova-plugin-ionic-keyboard": "^2.0.5",
35 | "cordova-plugin-ionic-webview": "^4.1.3",
36 | "cordova-plugin-splashscreen": "^5.0.2",
37 | "cordova-plugin-whitelist": "^1.3.3",
38 | "core-js": "^2.5.3",
39 | "crypto-browserify": "^1.0.9",
40 | "rxjs": "6.2.1",
41 | "stream": "0.0.2",
42 | "zone.js": "^0.8.26"
43 | },
44 | "devDependencies": {
45 | "@angular-devkit/build-angular": "0.6.8",
46 | "@angular-devkit/core": "0.6.8",
47 | "@angular-devkit/schematics": "0.6.8",
48 | "@angular/cli": "6.0.8",
49 | "@angular/compiler": "6.0.4",
50 | "@angular/compiler-cli": "6.0.4",
51 | "@angular/language-service": "6.0.4",
52 | "@types/jasmine": "~2.8.6",
53 | "@types/jasminewd2": "~2.0.3",
54 | "@types/node": "~10.1.0",
55 | "@types/uuid": "^3.4.3",
56 | "codelyzer": "~4.3.0",
57 | "jasmine-core": "~2.99.1",
58 | "jasmine-spec-reporter": "~4.2.1",
59 | "karma": "~1.7.1",
60 | "karma-chrome-launcher": "~2.2.0",
61 | "karma-coverage-istanbul-reporter": "~2.0.0",
62 | "karma-jasmine": "~1.1.1",
63 | "karma-jasmine-html-reporter": "^0.2.2",
64 | "protractor": "~5.3.0",
65 | "ts-node": "~6.0.2",
66 | "tslint": "~5.10.0",
67 | "typescript": "~2.7.2",
68 | "uuid": "^3.2.1"
69 | },
70 | "description": "An Ionic project",
71 | "cordova": {
72 | "plugins": {
73 | "cordova-plugin-whitelist": {},
74 | "cordova-plugin-device": {},
75 | "cordova-plugin-splashscreen": {},
76 | "cordova-plugin-ionic-webview": {},
77 | "cordova-plugin-ionic-keyboard": {}
78 | },
79 | "platforms": [
80 | "ios",
81 | "android"
82 | ]
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/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 | "kebab-case"
126 | ],
127 | "no-output-on-prefix": true,
128 | "use-input-property-decorator": true,
129 | "use-output-property-decorator": true,
130 | "use-host-property-decorator": true,
131 | "no-input-rename": true,
132 | "no-output-rename": true,
133 | "use-life-cycle-interface": true,
134 | "use-pipe-transform-interface": true,
135 | "directive-class-suffix": true
136 | }
137 | }
138 |
--------------------------------------------------------------------------------
/src/app/pages/list/list.page.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Input } from '@angular/core';
2 | import { ModalController, Events } from '@ionic/angular';
3 | import { AmplifyService } from 'aws-amplify-angular'
4 | import { ListItemModal } from './list.item.modal';
5 | import { ToDoItem, ToDoList } from '../../classes/item.class';
6 |
7 | @Component({
8 | selector: 'app-list-page',
9 | templateUrl: 'list.page.html',
10 | styleUrls: ['list.page.scss']
11 | })
12 | export class ListPage implements OnInit {
13 |
14 | amplifyService: AmplifyService;
15 | modal: any;
16 | data: any;
17 | user: any;
18 | itemList: ToDoList|any;
19 | signedIn: boolean;
20 |
21 | constructor(
22 | public modalController: ModalController,
23 | amplify: AmplifyService,
24 | events: Events
25 |
26 | ) {
27 |
28 | this.amplifyService = amplify;
29 | // Listen for changes to the AuthState in order to change item list appropriately
30 | events.subscribe('data:AuthState', async (data) => {
31 | if (data.user){
32 | this.user = await this.amplifyService.auth().currentUserInfo();
33 | this.getItems();
34 | } else {
35 | this.itemList = [];
36 | this.user = null;
37 | }
38 | })
39 |
40 |
41 | }
42 |
43 | async ngOnInit(){
44 | // Use AWS Amplify to get user data when creating items
45 | this.user = await this.amplifyService.auth().currentUserInfo();
46 | this.getItems();
47 | }
48 |
49 | async modify(item, i) {
50 | let props = {
51 | itemList: this.itemList || new ToDoList({userId: this.user.id}),
52 | /*
53 | We pass in an item paramenter only when the user clicks on an existing item
54 | and therefore populate an editItem value so that our modal knows this is an edit operation.
55 | */
56 | editItem: item || undefined
57 | };
58 |
59 | // Create the modal
60 | this.modal = await this.modalController.create({
61 | component: ListItemModal,
62 | componentProps: props
63 | });
64 |
65 | // Listen for the modal to be closed...
66 | this.modal.onDidDismiss((result) => {
67 | if (result.data.newItem){
68 | // ...and add a new item if modal passes back newItem
69 | result.data.itemList.items.push(result.data.newItem)
70 | } else if (result.data.editItem){
71 | // ...or splice the items array if the modal passes back editItem
72 | result.data.itemList.items[i] = result.data.editItem
73 | }
74 | this.save(result.data.itemList);
75 | })
76 | return this.modal.present()
77 | }
78 |
79 | delete(i){
80 | this.itemList.items.splice(i, 1);
81 | this.save(this.itemList);
82 |
83 | }
84 |
85 | complete(i){
86 | this.itemList.items[i].status = "complete";
87 | this.save(this.itemList);
88 | }
89 |
90 | save(list){
91 | // Use AWS Amplify to save the list...
92 | this.amplifyService.api().post('ToDoItemsCRUD', '/ToDoItems', {body: list}).then((i) => {
93 | // ... and to get the list after we save it.
94 | this.getItems()
95 | })
96 | .catch((err) => {
97 | console.log(`Error saving list: ${err}`)
98 | })
99 | }
100 |
101 | getItems(){
102 | if (this.user){
103 | // Use AWS Amplify to get the list
104 | this.amplifyService.api().get('ToDoItemsCRUD', `/ToDoItems/${this.user.id}`, {}).then((res) => {
105 | if (res && res.length > 0){
106 | this.itemList = res[0];
107 | } else {
108 | this.itemList = new ToDoList({userId: this.user.id, items: []});
109 | }
110 | })
111 | .catch((err) => {
112 | console.log(`Error getting list: ${err}`)
113 | })
114 | } else {
115 | console.log('Cannot get items: no active user')
116 | }
117 | }
118 |
119 | }
120 |
--------------------------------------------------------------------------------
/src/assets/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @copyright 2018 Amazon Web Services
3 | *
4 | * An example service worker that utilizes lifecycle events.
5 | * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
6 | *
7 | * This service worker provides the means to cache local static assets
8 | * into browsers Cache Storage as well as network requests using the
9 | * fetch events. Network requests and static assets are cached and
10 | * available offline. Other strategies exist for offline application development:
11 | * https://hacks.mozilla.org/2016/10/offline-strategies-come-to-the-service-worker-cookbook/
12 | *
13 | */
14 |
15 | /**
16 | * Static assets to cache. This is specific on your application
17 | * and build process and framework
18 | */
19 | var appCacheFiles = [
20 | '/',
21 | '/index.html'
22 | ],
23 | // The name of the Cache Storage
24 | appCache = 'aws-amplify-v1';
25 |
26 | /**
27 | * The install event is fired when the service worker
28 | * is installed.
29 | * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
30 | */
31 | addEventListener('install', (event) => {
32 | console.log('[Service Worker] Install Event', event)
33 | event.waitUntil(
34 | caches.open(appCache).then(function(cache) {
35 | return cache.addAll(appCacheFiles);
36 | })
37 | );
38 | })
39 |
40 | /**
41 | * The activate vent is fired when the service worker is activated
42 | * and added to the home screen.
43 | * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
44 | */
45 | addEventListener('activate', (event) => {
46 | console.log('[Service Worker] Activate Event ', event)
47 | })
48 |
49 | /**
50 | * The fetch event is fired for every network request. It is also dependent
51 | * on the scope of which your service worker was registered.
52 | * https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
53 | */
54 | addEventListener('fetch', function(event) {
55 | return fetch(event.request);
56 |
57 | /* cache-then-network
58 | console.log('[Service Worker] Fetch: ', event);
59 | let url = new URL(event.request.url);
60 | //url.pathname
61 | event.respondWith(
62 | caches.match(event.request).then(function(resp) {
63 | return resp || fetch(event.request).then(function(response) {
64 | return caches.open(appCache).then(function(cache) {
65 | if (event.request.method === 'GET') {
66 | cache.put(event.request, response.clone());
67 | }
68 | return response;
69 | });
70 | });
71 | })
72 | );
73 | */
74 | });
75 | /**
76 | * The message will receive messages sent from the application.
77 | * This can be useful for updating a service worker or messaging
78 | * other clients (browser restrictions currently exist)
79 | * https://developer.mozilla.org/en-US/docs/Web/API/Client/postMessage
80 | */
81 | addEventListener('message', (event) => {
82 | console.log('[Service Worker] Message Event: ', event.data)
83 | })
84 |
85 | /**
86 | * Listen for incoming Push events
87 | */
88 | addEventListener('push', (event) => {
89 | console.log('[Service Worker] Push Received.');
90 | console.log(`[Service Worker] Push had this data: "${event.data.text()}"`);
91 |
92 | if (!(self.Notification && self.Notification.permission === 'granted')) {
93 | return;
94 | }
95 | var data = {};
96 | if (event.data) {
97 | try {
98 | data = event.data.json();
99 | } catch(error) {
100 | data = {
101 | 'title': 'Push Notifications',
102 | 'message': event.data.text()
103 | }
104 | }
105 | }
106 | var title = data.title || "Web Push Notification";
107 | var message = data.message || "New Push Notification Received";
108 | var icon = "images/notification-icon.png";
109 | var badge = 'images/notification-badge.png';
110 | var options = {
111 | body: message,
112 | icon: icon,
113 | badge: badge
114 | };
115 | event.waitUntil(self.registration.showNotification(title,options));
116 | });
117 |
118 | /**
119 | * Handle a notification click
120 | */
121 | addEventListener('notificationclick', (event) => {
122 | console.log('[Service Worker] Notification click: ', event);
123 | event.notification.close();
124 | event.waitUntil(
125 | clients.openWindow('https://aws.github.io/aws-amplify')
126 | );
127 | });
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
3 | "version": 1,
4 | "projects": {
5 | "app": {
6 | "root": "",
7 | "sourceRoot": "src",
8 | "projectType": "application",
9 | "prefix": "app",
10 | "schematics": {},
11 | "architect": {
12 | "build": {
13 | "builder": "@angular-devkit/build-angular:browser",
14 | "options": {
15 | "progress": false,
16 | "outputPath": "www",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | {
23 | "glob": "**/*",
24 | "input": "src/assets",
25 | "output": "assets"
26 | },
27 | {
28 | "glob": "**/*.svg",
29 | "input": "node_modules/@ionic/angular/dist/ionic/svg",
30 | "output": "./svg"
31 | }
32 | ],
33 | "styles": [
34 | {
35 | "input": "src/theme/variables.scss"
36 | },
37 | {
38 | "input": "src/global.scss"
39 | }
40 | ],
41 | "scripts": []
42 | },
43 | "configurations": {
44 | "production": {
45 | "fileReplacements": [
46 | {
47 | "replace": "src/environments/environment.ts",
48 | "with": "src/environments/environment.prod.ts"
49 | }
50 | ],
51 | "optimization": true,
52 | "outputHashing": "all",
53 | "sourceMap": false,
54 | "extractCss": true,
55 | "namedChunks": false,
56 | "aot": true,
57 | "extractLicenses": true,
58 | "vendorChunk": false,
59 | "buildOptimizer": true
60 | }
61 | }
62 | },
63 | "serve": {
64 | "builder": "@angular-devkit/build-angular:dev-server",
65 | "options": {
66 | "browserTarget": "app:build"
67 | },
68 | "configurations": {
69 | "production": {
70 | "browserTarget": "app:build:production"
71 | }
72 | }
73 | },
74 | "extract-i18n": {
75 | "builder": "@angular-devkit/build-angular:extract-i18n",
76 | "options": {
77 | "browserTarget": "app:build"
78 | }
79 | },
80 | "test": {
81 | "builder": "@angular-devkit/build-angular:karma",
82 | "options": {
83 | "main": "src/test.ts",
84 | "polyfills": "src/polyfills.ts",
85 | "tsConfig": "src/tsconfig.spec.json",
86 | "karmaConfig": "src/karma.conf.js",
87 | "styles": [
88 | "styles.css"
89 | ],
90 | "scripts": [],
91 | "assets": [
92 | {
93 | "glob": "favicon.ico",
94 | "input": "src/",
95 | "output": "/"
96 | },
97 | {
98 | "glob": "**/*",
99 | "input": "src/assets",
100 | "output": "/assets"
101 | }
102 | ]
103 | }
104 | },
105 | "lint": {
106 | "builder": "@angular-devkit/build-angular:tslint",
107 | "options": {
108 | "tsConfig": [
109 | "src/tsconfig.app.json",
110 | "src/tsconfig.spec.json"
111 | ],
112 | "exclude": [
113 | "**/node_modules/**"
114 | ]
115 | }
116 | }
117 | }
118 | },
119 | "app-e2e": {
120 | "root": "e2e/",
121 | "projectType": "application",
122 | "architect": {
123 | "e2e": {
124 | "builder": "@angular-devkit/build-angular:protractor",
125 | "options": {
126 | "protractorConfig": "e2e/protractor.conf.js",
127 | "devServerTarget": "app:serve"
128 | }
129 | },
130 | "lint": {
131 | "builder": "@angular-devkit/build-angular:tslint",
132 | "options": {
133 | "tsConfig": "e2e/tsconfig.e2e.json",
134 | "exclude": [
135 | "**/node_modules/**"
136 | ]
137 | }
138 | }
139 | }
140 | }
141 | },
142 | "defaultProject": "app"
143 | }
144 |
--------------------------------------------------------------------------------
/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | amplify-ionic-sample-app
4 | An awesome Ionic/Cordova app.
5 | Ionic Framework Team
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
2 |
3 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
4 |
5 | Definitions.
6 |
7 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
8 |
9 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
10 |
11 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
12 |
13 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
14 |
15 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
16 |
17 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
18 |
19 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
20 |
21 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
22 |
23 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
24 |
25 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
26 |
27 | Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
28 |
29 | Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
30 |
31 | Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
32 |
33 | (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
34 |
35 | (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
36 |
37 | (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38 |
39 | (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
40 |
41 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
42 |
43 | Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
44 |
45 | Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
46 |
47 | Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
48 |
49 | Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
50 |
51 | Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
52 |
53 | END OF TERMS AND CONDITIONS
54 |
55 | APPENDIX: How to apply the Apache License to your work.
56 |
57 | To apply the Apache License to your work, attach the following
58 | boilerplate notice, with the fields enclosed by brackets "[]"
59 | replaced with your own identifying information. (Don't include
60 | the brackets!) The text should be enclosed in the appropriate
61 | comment syntax for the file format. We also recommend that a
62 | file or class name and description of purpose be included on the
63 | same "printed page" as the copyright notice for easier
64 | identification within third-party archives.
65 | Copyright [yyyy] [name of copyright owner]
66 |
67 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
68 |
69 | http://www.apache.org/licenses/LICENSE-2.0
70 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
--------------------------------------------------------------------------------