├── web
├── src
│ ├── assets
│ │ └── .gitkeep
│ ├── app
│ │ ├── home
│ │ │ ├── index.ts
│ │ │ ├── home.component.scss
│ │ │ ├── home.component.html
│ │ │ ├── home.component.ts
│ │ │ └── home.component.spec.ts
│ │ ├── shared
│ │ │ ├── index.ts
│ │ │ └── shared.module.ts
│ │ ├── index.ts
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── app.component.scss
│ │ ├── app-routing.module.ts
│ │ ├── app.module.ts
│ │ └── app.component.spec.ts
│ ├── scss
│ │ └── _variables.scss
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── typings.d.ts
│ ├── testing
│ │ ├── router-stubs
│ │ │ ├── router-outlet-stub.component.ts
│ │ │ ├── router-stub.service.ts
│ │ │ ├── router-link-stub.directive.ts
│ │ │ ├── activated-route-stub.service.ts
│ │ │ └── router-stubs.module.ts
│ │ └── index.ts
│ ├── index.html
│ ├── main.ts
│ ├── tsconfig.json
│ ├── polyfills.ts
│ ├── styles.scss
│ └── test.ts
├── e2e
│ ├── app.po.ts
│ ├── tsconfig.json
│ └── app.e2e-spec.ts
├── .gitignore
├── protractor.conf.js
├── karma.conf.js
├── README.md
├── .angular-cli.json
└── package.json
├── x-shared
├── app
│ └── home
│ │ ├── index.ts
│ │ ├── home-common.view-model.ts
│ │ └── home-common.view-model.spec.ts
├── tsconfig.json
└── scss
│ └── _variables.scss
├── nativescript
├── app
│ ├── scss
│ │ ├── _app-common.scss
│ │ └── _variables.scss
│ ├── App_Resources
│ │ ├── iOS
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── Contents.json
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ ├── icon-29.png
│ │ │ │ │ ├── icon-40.png
│ │ │ │ │ ├── icon-50.png
│ │ │ │ │ ├── icon-57.png
│ │ │ │ │ ├── icon-72.png
│ │ │ │ │ ├── icon-76.png
│ │ │ │ │ ├── icon-29@2x.png
│ │ │ │ │ ├── icon-29@3x.png
│ │ │ │ │ ├── icon-40@2x.png
│ │ │ │ │ ├── icon-40@3x.png
│ │ │ │ │ ├── icon-50@2x.png
│ │ │ │ │ ├── icon-57@2x.png
│ │ │ │ │ ├── icon-60@2x.png
│ │ │ │ │ ├── icon-60@3x.png
│ │ │ │ │ ├── icon-72@2x.png
│ │ │ │ │ ├── icon-76@2x.png
│ │ │ │ │ ├── icon-83.5@2x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── LaunchImage.launchimage
│ │ │ │ │ ├── Default.png
│ │ │ │ │ ├── Default@2x.png
│ │ │ │ │ ├── Default-568h@2x.png
│ │ │ │ │ ├── Default-667h@2x.png
│ │ │ │ │ ├── Default-736h@3x.png
│ │ │ │ │ ├── Default-Portrait.png
│ │ │ │ │ ├── Default-Landscape.png
│ │ │ │ │ ├── Default-Portrait@2x.png
│ │ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ ├── LaunchScreen.Center.imageset
│ │ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ │ ├── LaunchScreen-Center@2x.png
│ │ │ │ │ └── Contents.json
│ │ │ │ └── LaunchScreen.AspectFill.imageset
│ │ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ │ ├── LaunchScreen-AspectFill@2x.png
│ │ │ │ │ └── Contents.json
│ │ │ ├── build.xcconfig
│ │ │ ├── Info.plist
│ │ │ └── LaunchScreen.storyboard
│ │ └── Android
│ │ │ ├── values-v21
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ │ ├── drawable-hdpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── drawable-ldpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── drawable-mdpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── drawable-xhdpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── drawable-xxhdpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ ├── icon.png
│ │ │ ├── logo.png
│ │ │ └── background.png
│ │ │ ├── values
│ │ │ ├── strings.xml
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ │ ├── drawable-nodpi
│ │ │ └── splash_screen.xml
│ │ │ ├── app.gradle
│ │ │ └── AndroidManifest.xml
│ ├── main.ts
│ ├── modules
│ │ ├── home
│ │ │ ├── home.component.html
│ │ │ ├── home.component.scss
│ │ │ └── home.component.ts
│ │ ├── app-routing.module.ts
│ │ ├── app.component.ts
│ │ └── app.module.ts
│ ├── app.ios.scss
│ ├── app.android.scss
│ └── package.json
├── .gitignore
├── references.d.ts
├── tsconfig.json
└── package.json
├── .gitignore
├── typings.json
├── .editorconfig
├── LICENSE
├── package.json
├── tslint.json
├── tools
└── install.js
└── README.md
/web/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/web/src/app/home/index.ts:
--------------------------------------------------------------------------------
1 | export * from './home.component';
2 |
--------------------------------------------------------------------------------
/web/src/app/shared/index.ts:
--------------------------------------------------------------------------------
1 | export * from './shared.module';
2 |
--------------------------------------------------------------------------------
/web/src/scss/_variables.scss:
--------------------------------------------------------------------------------
1 | @import "../x-shared/scss/variables";
2 |
--------------------------------------------------------------------------------
/x-shared/app/home/index.ts:
--------------------------------------------------------------------------------
1 | export * from './home-common.view-model';
2 |
--------------------------------------------------------------------------------
/web/src/app/index.ts:
--------------------------------------------------------------------------------
1 | export * from './app.component';
2 | export * from './app.module';
3 |
--------------------------------------------------------------------------------
/web/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/web/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/web/src/favicon.ico
--------------------------------------------------------------------------------
/nativescript/app/scss/_app-common.scss:
--------------------------------------------------------------------------------
1 | ActionBar {
2 | background-color: $c-primary;
3 | color: $c-primary-contrast;
4 | }
5 |
--------------------------------------------------------------------------------
/nativescript/.gitignore:
--------------------------------------------------------------------------------
1 | hooks
2 | lib
3 | node_modules
4 | platforms
5 | app/**/*.js.map
6 | app/**/*.js
7 | app/x-shared
8 | app/**/*.css
9 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/nativescript/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Needed for autocompletion and compilation.
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | npm-debug.log
3 | node_modules
4 | x-shared/**/*.js.map
5 | x-shared/app/**/*.js
6 | x-shared/**/*.css
7 | typings
8 | !x-shared/typings
9 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/x-shared/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "emitDecoratorMetadata": true,
5 | "experimentalDecorators": true,
6 | "baseUrl": "./"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/web/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | // Typings reference file, you can add your own global typings here
2 | // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html
3 |
4 | declare var System: any;
5 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/web/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Nativescript Angular Web Starter
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/Android/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/typings.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "xhr2": "github:gdi2290/typed-xhr2#69f2b8d40d0cd407c1b2a2f2f41fecc6852cabbb"
4 | },
5 | "globalDependencies": {
6 | "node": "registry:dt/node#6.0.0+20160925070332"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/web/src/testing/router-stubs/router-outlet-stub.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'router-outlet',
5 | template: ''
6 | })
7 | export class RouterOutletStubComponent { }
8 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/web/src/app/home/home.component.scss:
--------------------------------------------------------------------------------
1 | @import '../../scss/variables';
2 |
3 | .home {
4 | margin-top: 30px;
5 |
6 | .title {
7 | margin-bottom: 10px;
8 | }
9 |
10 | .message {
11 | margin-top: 10px;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/web/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.scss']
7 | })
8 | export class AppComponent {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/web/src/app/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Tap the button
3 |
4 |
5 |
6 | {{cvm.message}}
7 |
8 |
--------------------------------------------------------------------------------
/web/src/testing/router-stubs/router-stub.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { NavigationExtras } from '@angular/router';
3 |
4 | @Injectable()
5 | export class RouterStub {
6 | navigate(commands: any[], extras?: NavigationExtras) { }
7 | }
8 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/web/src/app/shared/shared.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { FormsModule } from '@angular/forms';
3 | import { CommonModule } from '@angular/common';
4 |
5 | @NgModule({
6 | exports: [CommonModule, FormsModule]
7 | })
8 | export class SharedModule { }
9 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nativescript Angular Web Starter
4 | Nativescript Angular Web Starter
5 |
6 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shripalsoni04/nativescript-angular-web-starter/HEAD/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/web/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | @import "../scss/_variables";
2 |
3 | .top-bar {
4 | background-color: $c-primary;
5 | color: $c-primary-contrast;
6 | height: 70px;
7 |
8 | .title {
9 | text-align: center;
10 | padding: 17px;
11 | }
12 | }
13 |
14 | .content-container {
15 | text-align: center;
16 | }
17 |
--------------------------------------------------------------------------------
/nativescript/app/main.ts:
--------------------------------------------------------------------------------
1 | // this import should be first in order to load some required settings (like globals and reflect-metadata)
2 | import { platformNativeScriptDynamic } from 'nativescript-angular/platform';
3 |
4 | import { AppModule } from './modules/app.module';
5 |
6 | platformNativeScriptDynamic().bootstrapModule(AppModule);
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
12 | [*.md]
13 | max_line_length = 0
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/web/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | // TODO: create webpage for e2e tests.
2 |
3 | // import { browser, element, by } from 'protractor';
4 |
5 | // export class WebPage {
6 | // navigateTo() {
7 | // return browser.get('/');
8 | // }
9 |
10 | // getParagraphText() {
11 | // return element(by.css('.title')).getText();
12 | // }
13 | // }
14 |
--------------------------------------------------------------------------------
/nativescript/app/modules/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/web/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Web
6 |
7 |
8 |
9 |
10 |
11 |
12 | Loading...
13 |
14 |
15 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/nativescript/app/app.ios.scss:
--------------------------------------------------------------------------------
1 | // Theme variables cusomizations
2 | @import "~/scss/variables";
3 |
4 | // Core CSS
5 | @import "~nativescript-theme-core/scss/index";
6 |
7 | // Style adjustments for iOS
8 | @import "~nativescript-theme-core/scss/platforms/index.ios";
9 |
10 | // App styles common to Android and iOS platforms.
11 | @import "~/scss/app-common";
12 |
13 | // iOS specific app styles
14 |
--------------------------------------------------------------------------------
/web/src/main.ts:
--------------------------------------------------------------------------------
1 | import './polyfills.ts';
2 |
3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
4 | import { enableProdMode } from '@angular/core';
5 | import { environment } from './environments/environment';
6 | import { AppModule } from './app';
7 |
8 | if (environment.production) {
9 | enableProdMode();
10 | }
11 |
12 | platformBrowserDynamic().bootstrapModule(AppModule);
13 |
--------------------------------------------------------------------------------
/web/src/testing/router-stubs/router-link-stub.directive.ts:
--------------------------------------------------------------------------------
1 | import { Directive, Input } from '@angular/core';
2 |
3 | @Directive({
4 | selector: '[routerLink]',
5 | host: {
6 | '(click)': 'onClick()'
7 | }
8 | })
9 | export class RouterLinkStubDirective {
10 | @Input('routerLink') linkParams: any;
11 | navigatedTo: any = null;
12 |
13 | onClick() {
14 | this.navigatedTo = this.linkParams;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/nativescript/app/modules/home/home.component.scss:
--------------------------------------------------------------------------------
1 | @import "~/scss/variables";
2 |
3 | button, label, stack-layout {
4 | horizontal-align: center;
5 | }
6 |
7 | button {
8 | font-size: 36;
9 | }
10 |
11 | .title {
12 | font-size: 30;
13 | margin: 20;
14 | color: $c-primary-text;
15 | }
16 |
17 | .message {
18 | font-size: 20;
19 | text-align: center;
20 | margin: 0 20;
21 | color: $c-secondary-text;
22 | }
23 |
--------------------------------------------------------------------------------
/web/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "declaration": false,
5 | "emitDecoratorMetadata": true,
6 | "experimentalDecorators": true,
7 | "module": "commonjs",
8 | "moduleResolution": "node",
9 | "outDir": "../dist/out-tsc-e2e",
10 | "sourceMap": true,
11 | "target": "es5",
12 | "typeRoots": [
13 | "../node_modules/@types"
14 | ]
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/web/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 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/web/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | // TODO: Write e2e test case
2 |
3 | // import { WebPage } from './app.po';
4 |
5 | // describe('web App', function() {
6 | // let page: WebPage;
7 |
8 | // beforeEach(() => {
9 | // page = new WebPage();
10 | // });
11 |
12 | // it('should display message saying app works', () => {
13 | // page.navigateTo();
14 | // expect(page.getParagraphText()).toEqual('app works!');
15 | // });
16 | // });
17 |
--------------------------------------------------------------------------------
/web/src/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { HomeCommonViewModel } from '../../x-shared/app/home';
4 |
5 | @Component({
6 | selector: 'home',
7 | templateUrl: './home.component.html',
8 | styleUrls: ['./home.component.scss'],
9 | providers: [HomeCommonViewModel]
10 | })
11 | export class HomeComponent {
12 |
13 | constructor(public cvm: HomeCommonViewModel) {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "io.ngxp.nsngwebstarter"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/web/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule } from '@angular/router';
3 |
4 | import { HomeComponent } from './home/home.component';
5 |
6 | @NgModule({
7 | imports: [
8 | RouterModule.forRoot([
9 | { path: '', pathMatch: 'full', component: HomeComponent }
10 | ])
11 | ],
12 | exports: [
13 | RouterModule
14 | ]
15 | })
16 | export class AppRoutingModule {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/web/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": false,
4 | "emitDecoratorMetadata": true,
5 | "experimentalDecorators": true,
6 | "lib": ["es6", "dom"],
7 | "mapRoot": "./",
8 | "module": "es6",
9 | "moduleResolution": "node",
10 | "outDir": "../dist/out-tsc",
11 | "sourceMap": true,
12 | "target": "es5",
13 | "typeRoots": [
14 | "../node_modules/@types"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/nativescript/app/scss/_variables.scss:
--------------------------------------------------------------------------------
1 | // Core variables
2 | @import "~nativescript-theme-core/scss/light";
3 |
4 | // Cross platform shared variables. Basically contains brand colors.
5 | @import "~/x-shared/scss/variables";
6 |
7 | // Nativescript theme color overrides.
8 | $primary: $c-primary;
9 | $secondary: $c-secondary;
10 | $accent: $c-accent;
11 |
12 | // Nativescript core theme variable overrides.
13 | $btn-color: $c-accent;
14 | $item-active-color:$c-accent;
15 |
--------------------------------------------------------------------------------
/nativescript/app/modules/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { HomeCommonViewModel } from '../../x-shared/app/home';
4 |
5 | @Component({
6 | selector: 'home',
7 | templateUrl: 'modules/home/home.component.html',
8 | styleUrls: ['modules/home/home.component.css'],
9 | providers: [HomeCommonViewModel]
10 | })
11 | export class HomeComponent {
12 |
13 | constructor(public cvm: HomeCommonViewModel) {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/x-shared/app/home/home-common.view-model.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable()
4 | export class HomeCommonViewModel {
5 |
6 | counter: number = 16;
7 |
8 | constructor() { }
9 |
10 | get message(): string {
11 | if (this.counter > 0) {
12 | return this.counter + ' taps left';
13 | } else {
14 | return 'Hoorraaay! \nYou are ready to start building!';
15 | }
16 | }
17 |
18 | onTap() {
19 | this.counter--;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/nativescript/app/modules/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 |
3 | import { NativeScriptRouterModule } from 'nativescript-angular/router';
4 |
5 | import { HomeComponent } from './home/home.component';
6 |
7 | @NgModule({
8 | imports: [
9 | NativeScriptRouterModule.forRoot([
10 | { path: '', pathMatch: 'full', component: HomeComponent }
11 | ])
12 | ],
13 | exports: [NativeScriptRouterModule]
14 | })
15 | export class AppRoutingModule {
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 |
--------------------------------------------------------------------------------
/x-shared/scss/_variables.scss:
--------------------------------------------------------------------------------
1 | // Color Variables
2 |
3 | // theme colors
4 | $c-primary: #8bc34a;
5 | $c-secondary: #689f38;
6 | $c-accent: #00bcd4;
7 | $c-dark-accent: #0097a7;
8 | $c-primary-text: #212121;
9 | $c-secondary-text: #757575;
10 |
11 | // common colors
12 | $c-white: #fff;
13 | $c-black: #000;
14 | $c-danger: #d50000;
15 |
16 | // grey palette
17 | $c-grey-200: #EEEEEE;
18 | $c-grey-300: #E0E0E0;
19 | $c-grey-400: #BDBDBD;
20 | $c-grey-500: #9E9E9E;
21 | $c-grey-800: #424242;
22 |
23 | $c-primary-contrast: $c-white;
24 | $c-accent-contrast: $c-white;
25 |
--------------------------------------------------------------------------------
/nativescript/app/modules/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | import { SwissArmyKnife } from 'nativescript-swiss-army-knife';
4 |
5 | @Component({
6 | selector: 'my-app',
7 | template: ``
8 | })
9 | export class AppComponent {
10 |
11 | constructor() {
12 | // Setting $c-secondary color to android statusBar.
13 | SwissArmyKnife.setAndroidStatusBarColor('#689f38');
14 |
15 | // Setting StatusBarStyle to UIBarStyleBlack for iOS.
16 | SwissArmyKnife.actionBarSetStatusBarStyle(1);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/nativescript/app/modules/app.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 |
3 | import { NativeScriptModule } from 'nativescript-angular/nativescript.module';
4 |
5 | import { AppComponent } from './app.component';
6 | import { HomeComponent } from './home/home.component';
7 | import { AppRoutingModule } from './app-routing.module';
8 |
9 | @NgModule({
10 | declarations: [
11 | AppComponent,
12 | HomeComponent
13 | ],
14 | imports: [
15 | NativeScriptModule,
16 | AppRoutingModule
17 | ],
18 | bootstrap: [AppComponent]
19 | })
20 | export class AppModule { }
21 |
--------------------------------------------------------------------------------
/web/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 |
7 | # dependencies
8 | /node_modules
9 | /bower_components
10 |
11 | # IDEs and editors
12 | /.idea
13 | /.vscode
14 | .project
15 | .classpath
16 | *.launch
17 | .settings/
18 |
19 | # misc
20 | /.sass-cache
21 | /connect.lock
22 | /coverage/*
23 | /libpeerconnection.log
24 | npm-debug.log
25 | testem.log
26 | /typings
27 |
28 | # e2e
29 | /e2e/*.js
30 | /e2e/*.map
31 |
32 | #System Files
33 | .DS_Store
34 | Thumbs.db
35 |
36 | # x-shared
37 | src/x-shared
38 |
--------------------------------------------------------------------------------
/nativescript/app/app.android.scss:
--------------------------------------------------------------------------------
1 | // Theme variables cusomizations
2 | @import "~/scss/variables";
3 |
4 | // Core CSS
5 | @import "~nativescript-theme-core/scss/index";
6 |
7 | // Style adjustments for Android
8 | @import "~nativescript-theme-core/scss/platforms/index.android";
9 |
10 | // App styles common to Android and iOS platforms.
11 | @import "~/scss/app-common";
12 |
13 | // Android specific app styles
14 | .action-bar-icon {
15 | width: 60;
16 | }
17 |
18 | // Globally applying button color to let it apply to dialog buttons.
19 | Button {
20 | color: $c-accent;
21 | }
22 |
23 | .btn-primary:highlighted {
24 | background-color: $c-dark-accent;
25 | }
26 |
--------------------------------------------------------------------------------
/web/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { HttpModule } from '@angular/http';
4 |
5 | import { AppComponent } from './app.component';
6 | import { HomeComponent } from './home';
7 | import { AppRoutingModule } from './app-routing.module';
8 | import { SharedModule } from './shared';
9 |
10 | @NgModule({
11 | declarations: [
12 | AppComponent,
13 | HomeComponent
14 | ],
15 | imports: [
16 | BrowserModule,
17 | HttpModule,
18 | AppRoutingModule,
19 | SharedModule
20 | ],
21 | providers: [],
22 | bootstrap: [AppComponent]
23 | })
24 | export class AppModule { }
25 |
--------------------------------------------------------------------------------
/web/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | // This file includes polyfills needed by Angular 2 and is loaded before
2 | // the app. You can add your own extra polyfills to this file.
3 | import 'core-js/es6/symbol';
4 | import 'core-js/es6/object';
5 | import 'core-js/es6/function';
6 | import 'core-js/es6/parse-int';
7 | import 'core-js/es6/parse-float';
8 | import 'core-js/es6/number';
9 | import 'core-js/es6/math';
10 | import 'core-js/es6/string';
11 | import 'core-js/es6/date';
12 | import 'core-js/es6/array';
13 | import 'core-js/es6/regexp';
14 | import 'core-js/es6/map';
15 | import 'core-js/es6/set';
16 | import 'core-js/es6/reflect';
17 |
18 | import 'core-js/es7/reflect';
19 | import 'zone.js/dist/zone';
20 |
--------------------------------------------------------------------------------
/nativescript/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es5",
5 | "experimentalDecorators": true,
6 | "emitDecoratorMetadata": true,
7 | "noEmitHelpers": true,
8 | "noEmitOnError": true,
9 | "lib": [
10 | "es6",
11 | "dom",
12 | "es2015.iterable"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "*": [
17 | "./node_modules/tns-core-modules/*",
18 | "./node_modules/*"
19 | ]
20 | }
21 | },
22 | "exclude": [
23 | "node_modules",
24 | "platforms"
25 | ]
26 | }
--------------------------------------------------------------------------------
/web/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import "scss/variables";
3 |
4 | html, body {
5 | padding: 0;
6 | margin: 0;
7 | font-family: sans-serif;
8 | }
9 |
10 | h1, h2, h3, h4, h5, h6 {
11 | margin: 0;
12 | }
13 |
14 | .btn-primary {
15 | font-size: 16px;
16 | background-color: $c-accent;
17 | color: $c-accent-contrast;
18 | border: 0;
19 | padding: 15px;
20 | border-radius: 3px;
21 | outline: 0;
22 | cursor: pointer;
23 | }
24 |
25 | .btn-primary:active {
26 | background-color: $c-dark-accent;
27 | }
28 |
29 | .text-primary {
30 | color: $c-primary-text;
31 | }
32 |
33 | .text-secondary {
34 | color: $c-secondary-text;
35 | }
36 |
--------------------------------------------------------------------------------
/web/src/testing/router-stubs/activated-route-stub.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 |
4 | import { Observable } from 'rxjs/Observable';
5 | import { BehaviorSubject } from 'rxjs/BehaviorSubject';
6 |
7 | @Injectable()
8 | export class ActivatedRouteStub {
9 |
10 | private subject = new BehaviorSubject(this.testParams);
11 | params = this.subject.asObservable();
12 |
13 | // Test parameters
14 | private _testParams: {};
15 | get testParams() { return this._testParams; }
16 | set testParams(params: {}) {
17 | this._testParams = params;
18 | this.subject.next(params);
19 | }
20 |
21 | // ActivatedRoute.snapshot.params
22 | get snapshot() {
23 | return { params: this.testParams };
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/web/src/testing/router-stubs/router-stubs.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Router } from '@angular/router';
3 |
4 | import { RouterLinkStubDirective } from './router-link-stub.directive';
5 | import { RouterOutletStubComponent } from './router-outlet-stub.component';
6 | import { RouterStub } from './router-stub.service';
7 |
8 | // export for convenience.
9 | export { ActivatedRoute, Router, RouterLink, RouterOutlet } from '@angular/router';
10 |
11 | @NgModule({
12 | declarations: [
13 | RouterLinkStubDirective,
14 | RouterOutletStubComponent
15 | ],
16 | exports: [
17 | RouterLinkStubDirective,
18 | RouterOutletStubComponent
19 | ],
20 | providers: [
21 | { provide: Router, useClass: RouterStub }
22 | ]
23 | })
24 | export class RoutingStubsModule { }
25 |
--------------------------------------------------------------------------------
/web/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable:no-unused-variable */
2 |
3 | import { TestBed, async, ComponentFixture } from '@angular/core/testing';
4 | import { RouterModule } from '@angular/router';
5 |
6 | import { AppComponent } from './app.component';
7 |
8 | import { RoutingStubsModule } from '../testing';
9 |
10 | describe('AppComponent', () => {
11 |
12 | let fixture: ComponentFixture;
13 | let comp: AppComponent;
14 |
15 | beforeEach(() => {
16 | TestBed.configureTestingModule({
17 | imports: [
18 | RoutingStubsModule
19 | ],
20 | declarations: [
21 | AppComponent
22 | ],
23 | });
24 |
25 | fixture = TestBed.createComponent(AppComponent);
26 | comp = fixture.componentInstance;
27 | });
28 |
29 | it('should create AppComponent', async(() => {
30 | expect(comp).toBeTruthy();
31 | }));
32 | });
33 |
--------------------------------------------------------------------------------
/web/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/docs/referenceConf.js
3 |
4 | /*global jasmine */
5 | var SpecReporter = require('jasmine-spec-reporter');
6 |
7 | exports.config = {
8 | allScriptsTimeout: 11000,
9 | specs: [
10 | './e2e/**/*.e2e-spec.ts'
11 | ],
12 | capabilities: {
13 | 'browserName': 'chrome'
14 | },
15 | directConnect: true,
16 | baseUrl: 'http://localhost:4200/',
17 | framework: 'jasmine',
18 | jasmineNodeOpts: {
19 | showColors: true,
20 | defaultTimeoutInterval: 30000,
21 | print: function() {}
22 | },
23 | useAllAngular2AppRoots: true,
24 | beforeLaunch: function() {
25 | require('ts-node').register({
26 | project: 'e2e'
27 | });
28 | },
29 | onPrepare: function() {
30 | jasmine.getEnv().addReporter(new SpecReporter());
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/x-shared/app/home/home-common.view-model.spec.ts:
--------------------------------------------------------------------------------
1 | import { HomeCommonViewModel } from './home-common.view-model';
2 |
3 | describe('HomeCommonViewModel', () => {
4 |
5 | let homeCommonVM: HomeCommonViewModel;
6 |
7 | beforeEach(() => {
8 | homeCommonVM = new HomeCommonViewModel();
9 | });
10 |
11 | it('should have initial counter value greater than 0', () => {
12 | expect(homeCommonVM.counter).toBeGreaterThan(0);
13 | });
14 |
15 | it('::onTap should decreament count by 1', () => {
16 | let initialCount = homeCommonVM.counter;
17 | homeCommonVM.onTap();
18 | expect(homeCommonVM.counter).toEqual(initialCount - 1);
19 | });
20 |
21 | it('should have tap count left in message when count greater than 0', () => {
22 | expect(homeCommonVM.message).toContain('taps left');
23 | });
24 |
25 | it('should have proper message count is 0', () => {
26 | homeCommonVM.counter = 0;
27 | expect(homeCommonVM.message).toContain('Hoorraaay! \nYou are ready to start building!');
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/web/src/testing/index.ts:
--------------------------------------------------------------------------------
1 | import { DebugElement } from '@angular/core';
2 | import { tick, ComponentFixture } from '@angular/core/testing';
3 |
4 | export { RoutingStubsModule } from './router-stubs/router-stubs.module';
5 |
6 | ///// Short utilities /////
7 |
8 | /** Wait a tick, then detect changes */
9 | export function advance(f: ComponentFixture): void {
10 | tick();
11 | f.detectChanges();
12 | }
13 |
14 | // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
15 | /** Button events to pass to `DebugElement.triggerEventHandler` for RouterLink event handler */
16 | export const ButtonClickEvents = {
17 | left: { button: 0 },
18 | right: { button: 2 }
19 | };
20 |
21 | /** Simulate element click. Defaults to mouse left-button click event. */
22 | export function click(el: DebugElement | HTMLElement, eventObj: any = ButtonClickEvents.left): void {
23 | if (el instanceof HTMLElement) {
24 | el.click();
25 | } else {
26 | el.triggerEventHandler('click', eventObj);
27 | }
28 | }
29 | /*
30 | Copyright 2016 Google Inc. All Rights Reserved.
31 | Use of this source code is governed by an MIT-style license that
32 | can be found in the LICENSE file at http://angular.io/license
33 | */
34 |
--------------------------------------------------------------------------------
/web/src/test.ts:
--------------------------------------------------------------------------------
1 | import './polyfills.ts';
2 |
3 | import 'zone.js/dist/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 |
10 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
11 | declare var __karma__: any;
12 | declare var require: any;
13 |
14 | // Prevent Karma from running prematurely.
15 | __karma__.loaded = function () {};
16 |
17 |
18 | Promise.all([
19 | System.import('@angular/core/testing'),
20 | System.import('@angular/platform-browser-dynamic/testing')
21 | ])
22 | // First, initialize the Angular testing environment.
23 | .then(([testing, testingBrowser]) => {
24 | testing.getTestBed().initTestEnvironment(
25 | testingBrowser.BrowserDynamicTestingModule,
26 | testingBrowser.platformBrowserDynamicTesting()
27 | );
28 | })
29 | // Then we find all the tests.
30 | .then(() => require.context('./', true, /\.spec\.ts/))
31 | // And load the modules.
32 | .then(context => context.keys().map(context))
33 | // Finally, start Karma to run the tests.
34 | .then(__karma__.start, __karma__.error);
35 |
--------------------------------------------------------------------------------
/web/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/0.13/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular/cli'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-remap-istanbul'),
12 | require('@angular/cli/plugins/karma')
13 | ],
14 | files: [
15 | { pattern: './src/test.ts', watched: false }
16 | ],
17 | preprocessors: {
18 | './src/test.ts': ['@angular/cli']
19 | },
20 | remapIstanbulReporter: {
21 | reports: {
22 | html: 'coverage',
23 | lcovonly: './coverage/coverage.lcov'
24 | }
25 | },
26 | angularCli: {
27 | config: './.angular-cli.json',
28 | environment: 'dev'
29 | },
30 | reporters: config.angularCli && config.angularCli.codeCoverage
31 | ? ['progress', 'karma-remap-istanbul']
32 | : ['progress'],
33 | port: 9876,
34 | colors: true,
35 | logLevel: config.LOG_INFO,
36 | autoWatch: true,
37 | browsers: ['Chrome'],
38 | singleRun: false
39 | });
40 | };
41 |
--------------------------------------------------------------------------------
/web/README.md:
--------------------------------------------------------------------------------
1 | # Web
2 |
3 | This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.19-3.
4 |
5 | ## Development server
6 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7 |
8 | ## Code scaffolding
9 |
10 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class`.
11 |
12 | ## Build
13 |
14 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
15 |
16 | ## Running unit tests
17 |
18 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
19 |
20 | ## Running end-to-end tests
21 |
22 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
23 | Before running the tests make sure you are serving the app via `ng serve`.
24 |
25 | ## Deploying to Github Pages
26 |
27 | Run `ng github-pages:deploy` to deploy to Github Pages.
28 |
29 | ## Further help
30 |
31 | To get more help on the `angular-cli` use `ng --help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
32 |
--------------------------------------------------------------------------------
/nativescript/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "io.ngxp.nsngwebstarter",
8 | "tns-android": {
9 | "version": "3.0.0"
10 | },
11 | "tns-ios": {
12 | "version": "3.0.1"
13 | }
14 | },
15 | "dependencies": {
16 | "@angular/animations": "~4.0.0",
17 | "@angular/common": "~4.0.0",
18 | "@angular/compiler": "~4.0.0",
19 | "@angular/core": "~4.0.0",
20 | "@angular/forms": "~4.0.0",
21 | "@angular/http": "~4.0.0",
22 | "@angular/platform-browser": "~4.0.0",
23 | "@angular/platform-browser-dynamic": "~4.0.0",
24 | "@angular/router": "~4.0.0",
25 | "nativescript-angular": "~3.0.0",
26 | "nativescript-swiss-army-knife": "^1.0.71",
27 | "nativescript-theme-core": "~1.0.4",
28 | "reflect-metadata": "~0.1.8",
29 | "rxjs": "~5.2.0",
30 | "tns-core-modules": "~3.0.0",
31 | "zone.js": "0.8.2"
32 | },
33 | "devDependencies": {
34 | "babel-traverse": "6.4.5",
35 | "babel-types": "6.4.5",
36 | "babylon": "6.4.5",
37 | "lazy": "1.0.11",
38 | "nativescript-dev-sass": "^1.1.1",
39 | "nativescript-dev-typescript": "^0.4.0",
40 | "typescript": "^2.3.2"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/web/.angular-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "project": {
3 | "version": "1.0.1",
4 | "name": "web"
5 | },
6 | "apps": [
7 | {
8 | "root": "src",
9 | "outDir": "dist",
10 | "assets": [
11 | "assets",
12 | "favicon.ico"
13 | ],
14 | "index": "index.html",
15 | "main": "main.ts",
16 | "test": "test.ts",
17 | "tsconfig": "tsconfig.json",
18 | "prefix": "app",
19 | "mobile": false,
20 | "styles": [
21 | "styles.scss"
22 | ],
23 | "scripts": [],
24 | "environmentSource": "environments/environment.ts",
25 | "environments": {
26 | "dev": "environments/environment.ts",
27 | "prod": "environments/environment.prod.ts"
28 | }
29 | }
30 | ],
31 | "addons": [],
32 | "packages": [],
33 | "e2e": {
34 | "protractor": {
35 | "config": "./protractor.conf.js"
36 | }
37 | },
38 | "test": {
39 | "karma": {
40 | "config": "./karma.conf.js"
41 | }
42 | },
43 | "defaults": {
44 | "styleExt": "css",
45 | "prefixInterfaces": false,
46 | "inline": {
47 | "style": false,
48 | "template": false
49 | },
50 | "spec": {
51 | "class": false,
52 | "component": true,
53 | "directive": true,
54 | "module": false,
55 | "pipe": true,
56 | "service": true
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/web/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "web",
3 | "version": "1.0.1",
4 | "license": "MIT",
5 | "angular-cli": {},
6 | "scripts": {
7 | "start": "ng serve",
8 | "lint": "tslint \"src/**/*.ts\"",
9 | "test": "ng test",
10 | "pree2e": "webdriver-manager update",
11 | "e2e": "protractor"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/common": "^4.1.3",
16 | "@angular/compiler": "^4.1.3",
17 | "@angular/core": "^4.1.3",
18 | "@angular/forms": "^4.1.3",
19 | "@angular/http": "^4.1.3",
20 | "@angular/platform-browser": "^4.1.3",
21 | "@angular/platform-browser-dynamic": "^4.1.3",
22 | "@angular/router": "^4.1.3",
23 | "core-js": "^2.4.1",
24 | "rxjs": "~5.2.0",
25 | "zone.js": "0.8.2",
26 | "ts-helpers": "^1.1.1",
27 | "typescript": "^2.3.2"
28 | },
29 | "devDependencies": {
30 | "@angular/cli": "^1.0.3",
31 | "@angular/compiler-cli": "^4.1.2",
32 | "@types/jasmine": "^2.2.30",
33 | "@types/node": "^6.0.42",
34 | "codelyzer": "^3.0.1",
35 | "jasmine-core": "^2.6.2",
36 | "jasmine-spec-reporter": "^4.1.0",
37 | "karma": "^1.7.0",
38 | "karma-chrome-launcher": "^2.1.1",
39 | "karma-cli": "^1.0.1",
40 | "karma-jasmine": "^1.1.0",
41 | "karma-remap-istanbul": "^0.6.0",
42 | "protractor": "^5.1.2",
43 | "ts-node": "^3.0.4",
44 | "tslint": "^5.2.0",
45 | "typescript": "^2.3.2",
46 | "webdriver-manager": "^12.0.6"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/nativescript/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": false,
3 | "nativescript": {
4 | "id": "org.nativescript.helloworldng"
5 | },
6 | "name": "tns-template-hello-world-ng",
7 | "main": "main.js",
8 | "version": "2.3.4",
9 | "author": "Telerik ",
10 | "description": "Nativescript Angular Hello World template",
11 | "license": "BSD",
12 | "keywords": [
13 | "telerik",
14 | "mobile",
15 | "angular",
16 | "nativescript",
17 | "{N}",
18 | "tns",
19 | "appbuilder",
20 | "template"
21 | ],
22 | "repository": {
23 | "type": "git",
24 | "url": "git://github.com/NativeScript/template-hello-world-ng"
25 | },
26 | "homepage": "https://github.com/NativeScript/template-hello-world-ng",
27 | "android": {
28 | "v8Flags": "--expose_gc"
29 | },
30 | "dependencies": {
31 | "nativescript-theme-core": "^0.1.3",
32 | "nativescript-angular": "1.1.2",
33 | "@angular/core": "2.1.2",
34 | "@angular/common": "2.1.2",
35 | "@angular/compiler": "2.1.2",
36 | "@angular/http": "2.1.2",
37 | "@angular/platform-browser": "2.1.2",
38 | "@angular/platform-browser-dynamic": "2.1.2",
39 | "@angular/forms": "2.1.2",
40 | "@angular/router": "3.1.2",
41 | "rxjs": "5.0.0-beta.12",
42 | "reflect-metadata": "~0.1.8"
43 | },
44 | "devDependencies": {
45 | "zone.js": "~0.6.21",
46 | "nativescript-dev-typescript": "^0.3.2"
47 | }
48 | }
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Nativescript Angular Web Starter
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | NativescriptAngularWebStarter
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/web/src/app/home/home.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, ComponentFixture, tick } from '@angular/core/testing';
2 | import { By } from '@angular/platform-browser';
3 |
4 | import { SharedModule } from '../shared';
5 | import { HomeComponent } from './home.component';
6 | import { click } from '../../testing';
7 |
8 | let fixture: ComponentFixture;
9 | let comp: HomeComponent;
10 |
11 | describe('HomeComponent', () => {
12 | beforeEach(() => {
13 | TestBed.configureTestingModule({
14 | imports: [
15 | SharedModule
16 | ],
17 | declarations: [
18 | HomeComponent
19 | ]
20 | });
21 |
22 | fixture = TestBed.createComponent(HomeComponent);
23 | comp = fixture.componentInstance;
24 | });
25 |
26 | it('should create HomeComponent', () => {
27 | expect(comp).toBeTruthy();
28 | });
29 |
30 | it('should render title as "Tap the button" in element with .title class', () => {
31 | let titleEle: HTMLElement = fixture.debugElement.query(By.css('.title')).nativeElement;
32 | expect(titleEle.textContent).toBe('Tap the button');
33 | });
34 |
35 | it('should display message in element with .message class', () => {
36 | let messageEle: HTMLElement = fixture.debugElement.query(By.css('.message')).nativeElement;
37 | fixture.detectChanges();
38 | expect(messageEle.textContent.length).toBeGreaterThan(0);
39 | });
40 |
41 | it('should decreament count by 1 on tap of button', () => {
42 | let btnEle: HTMLElement = fixture.debugElement.query(By.css('.btn-primary')).nativeElement;
43 | let initialCount = comp.cvm.counter;
44 | click(btnEle);
45 | fixture.detectChanges();
46 | expect(comp.cvm.counter).toBe(initialCount - 1);
47 | });
48 | });
49 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/Android/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-angular-web-starter",
3 | "version": "1.0.1",
4 | "description": "Starter for web and native mobile application with single code base. ",
5 | "scripts": {
6 | "ngxp-install": "npm install && cd web && npm install && cd ../nativescript && tns install && node ../tools/install.js && cd .. && typings install",
7 | "build": "cd web && ng build",
8 | "build.prod": "cd web && ng build --prod",
9 | "build.aot": "cd web && ng build --aot",
10 | "build.aot.prod": "cd web && ng build --aot --prod",
11 | "start": "cd web && ng serve",
12 | "start.prod": "cd web && ng serve --prod",
13 | "start.aot": "cd web && ng serve --aot",
14 | "start.aot.prod": "cd web && ng serve --aot --prod",
15 | "start.android": "cd nativescript && tns run android",
16 | "start.ios": "cd nativescript && tns run ios",
17 | "livesync.android": "cd nativescript && tns livesync android --watch",
18 | "livesync.ios": "cd nativescript && tns livesync ios --watch",
19 | "test": "cd web && ng test",
20 | "test-cc": "npm test -- -cc",
21 | "test.android": "cd nativescript && tns test android --watch",
22 | "test.ios": "cd nativescript && tns test ios --watch"
23 | },
24 | "keywords": [
25 | "nativescript",
26 | "angular4",
27 | "ng4",
28 | "angular"
29 | ],
30 | "author": "Shripal Soni",
31 | "license": "MIT",
32 | "devDependencies": {
33 | "@types/jasmine": "^2.2.30",
34 | "codelyzer": "~1.0.0-beta.4",
35 | "tslint": "^3.15.1",
36 | "typings": "^1.4.0"
37 | },
38 | "dependencies": {
39 | "@angular/animations": "^4.1.3",
40 | "@angular/common": "^4.1.3",
41 | "@angular/compiler": "^4.1.3",
42 | "@angular/compiler-cli": "^4.1.3",
43 | "@angular/core": "^4.1.3",
44 | "@angular/forms": "^4.1.3",
45 | "@angular/http": "^4.1.3",
46 | "@angular/platform-browser": "^4.1.3",
47 | "@angular/platform-browser-dynamic": "^4.1.3",
48 | "@angular/platform-server": "^4.1.3",
49 | "@angular/router": "^4.1.3",
50 | "core-js": "^2.4.1",
51 | "rxjs": "~5.2.0",
52 | "zone.js": "0.8.2",
53 | "ts-helpers": "^1.1.1"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "57x57",
35 | "idiom" : "iphone",
36 | "filename" : "icon-57.png",
37 | "scale" : "1x"
38 | },
39 | {
40 | "size" : "57x57",
41 | "idiom" : "iphone",
42 | "filename" : "icon-57@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "29x29",
59 | "idiom" : "ipad",
60 | "filename" : "icon-29.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "40x40",
71 | "idiom" : "ipad",
72 | "filename" : "icon-40.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-40@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "50x50",
83 | "idiom" : "ipad",
84 | "filename" : "icon-50.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "50x50",
89 | "idiom" : "ipad",
90 | "filename" : "icon-50@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "72x72",
95 | "idiom" : "ipad",
96 | "filename" : "icon-72.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "72x72",
101 | "idiom" : "ipad",
102 | "filename" : "icon-72@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "icon-76.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "icon-76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "icon-83.5@2x.png",
121 | "scale" : "2x"
122 | }
123 | ],
124 | "info" : {
125 | "version" : 1,
126 | "author" : "xcode"
127 | }
128 | }
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rulesDirectory": [
3 | "node_modules/codelyzer"
4 | ],
5 | "rules": {
6 | "class-name": true,
7 | "comment-format": [
8 | true,
9 | "check-space"
10 | ],
11 | "curly": true,
12 | "eofline": true,
13 | "forin": true,
14 | "indent": [
15 | true,
16 | "spaces"
17 | ],
18 | "label-position": true,
19 | "label-undefined": true,
20 | "max-line-length": [
21 | true,
22 | 140
23 | ],
24 | "member-access": false,
25 | "member-ordering": [
26 | true,
27 | "static-before-instance",
28 | "variables-before-functions"
29 | ],
30 | "no-arg": true,
31 | "no-bitwise": true,
32 | "no-console": [
33 | true,
34 | "debug",
35 | "info",
36 | "time",
37 | "timeEnd",
38 | "trace"
39 | ],
40 | "no-construct": true,
41 | "no-debugger": true,
42 | "no-duplicate-key": true,
43 | "no-duplicate-variable": true,
44 | "no-empty": false,
45 | "no-eval": true,
46 | "no-inferrable-types": true,
47 | "no-shadowed-variable": true,
48 | "no-string-literal": false,
49 | "no-switch-case-fall-through": true,
50 | "no-trailing-whitespace": true,
51 | "no-unused-expression": true,
52 | "no-unused-variable": true,
53 | "no-unreachable": true,
54 | "no-use-before-declare": true,
55 | "no-var-keyword": true,
56 | "object-literal-sort-keys": false,
57 | "one-line": [
58 | true,
59 | "check-open-brace",
60 | "check-catch",
61 | "check-else",
62 | "check-whitespace"
63 | ],
64 | "quotemark": [
65 | true,
66 | "single"
67 | ],
68 | "radix": true,
69 | "semicolon": [
70 | "always"
71 | ],
72 | "triple-equals": [
73 | true,
74 | "allow-null-check"
75 | ],
76 | "typedef-whitespace": [
77 | true,
78 | {
79 | "call-signature": "nospace",
80 | "index-signature": "nospace",
81 | "parameter": "nospace",
82 | "property-declaration": "nospace",
83 | "variable-declaration": "nospace"
84 | }
85 | ],
86 | "variable-name": false,
87 | "whitespace": [
88 | true,
89 | "check-branch",
90 | "check-decl",
91 | "check-operator",
92 | "check-separator",
93 | "check-type"
94 | ],
95 |
96 | "directive-selector-prefix": [true, "app"],
97 | "component-selector-prefix": [true, "app"],
98 | "directive-selector-name": [true, "camelCase"],
99 | "component-selector-name": [true, "kebab-case"],
100 | "directive-selector-type": [true, "attribute"],
101 | "component-selector-type": [true, "element"],
102 | "use-input-property-decorator": true,
103 | "use-output-property-decorator": true,
104 | "use-host-property-decorator": true,
105 | "no-input-rename": true,
106 | "no-output-rename": true,
107 | "use-life-cycle-interface": true,
108 | "use-pipe-transform-interface": true,
109 | "component-class-suffix": true,
110 | "directive-class-suffix": true,
111 | "templates-use-public": true,
112 | "invoke-injectable": true
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
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 |
--------------------------------------------------------------------------------
/nativescript/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "736h",
7 | "filename" : "Default-736h@3x.png",
8 | "minimum-system-version" : "8.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "736h",
16 | "filename" : "Default-Landscape@3x.png",
17 | "minimum-system-version" : "8.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "667h",
25 | "filename" : "Default-667h@2x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "filename" : "Default@2x.png",
34 | "extent" : "full-screen",
35 | "minimum-system-version" : "7.0",
36 | "scale" : "2x"
37 | },
38 | {
39 | "extent" : "full-screen",
40 | "idiom" : "iphone",
41 | "subtype" : "retina4",
42 | "filename" : "Default-568h@2x.png",
43 | "minimum-system-version" : "7.0",
44 | "orientation" : "portrait",
45 | "scale" : "2x"
46 | },
47 | {
48 | "orientation" : "portrait",
49 | "idiom" : "ipad",
50 | "filename" : "Default-Portrait.png",
51 | "extent" : "full-screen",
52 | "minimum-system-version" : "7.0",
53 | "scale" : "1x"
54 | },
55 | {
56 | "orientation" : "landscape",
57 | "idiom" : "ipad",
58 | "filename" : "Default-Landscape.png",
59 | "extent" : "full-screen",
60 | "minimum-system-version" : "7.0",
61 | "scale" : "1x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "ipad",
66 | "filename" : "Default-Portrait@2x.png",
67 | "extent" : "full-screen",
68 | "minimum-system-version" : "7.0",
69 | "scale" : "2x"
70 | },
71 | {
72 | "orientation" : "landscape",
73 | "idiom" : "ipad",
74 | "filename" : "Default-Landscape@2x.png",
75 | "extent" : "full-screen",
76 | "minimum-system-version" : "7.0",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "iphone",
82 | "filename" : "Default.png",
83 | "extent" : "full-screen",
84 | "scale" : "1x"
85 | },
86 | {
87 | "orientation" : "portrait",
88 | "idiom" : "iphone",
89 | "filename" : "Default@2x.png",
90 | "extent" : "full-screen",
91 | "scale" : "2x"
92 | },
93 | {
94 | "orientation" : "portrait",
95 | "idiom" : "iphone",
96 | "filename" : "Default-568h@2x.png",
97 | "extent" : "full-screen",
98 | "subtype" : "retina4",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "extent" : "to-status-bar",
105 | "scale" : "1x"
106 | },
107 | {
108 | "orientation" : "portrait",
109 | "idiom" : "ipad",
110 | "filename" : "Default-Portrait.png",
111 | "extent" : "full-screen",
112 | "scale" : "1x"
113 | },
114 | {
115 | "orientation" : "landscape",
116 | "idiom" : "ipad",
117 | "extent" : "to-status-bar",
118 | "scale" : "1x"
119 | },
120 | {
121 | "orientation" : "landscape",
122 | "idiom" : "ipad",
123 | "filename" : "Default-Landscape.png",
124 | "extent" : "full-screen",
125 | "scale" : "1x"
126 | },
127 | {
128 | "orientation" : "portrait",
129 | "idiom" : "ipad",
130 | "extent" : "to-status-bar",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "ipad",
136 | "filename" : "Default-Portrait@2x.png",
137 | "extent" : "full-screen",
138 | "scale" : "2x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "extent" : "to-status-bar",
144 | "scale" : "2x"
145 | },
146 | {
147 | "orientation" : "landscape",
148 | "idiom" : "ipad",
149 | "filename" : "Default-Landscape@2x.png",
150 | "extent" : "full-screen",
151 | "scale" : "2x"
152 | }
153 | ],
154 | "info" : {
155 | "version" : 1,
156 | "author" : "xcode"
157 | }
158 | }
--------------------------------------------------------------------------------
/tools/install.js:
--------------------------------------------------------------------------------
1 | // -----------------------------------------------------------
2 | // version 1.0.0
3 | // Copied some code from https://github.com/NathanWalker/angular-seed-advanced/tools/install.js
4 | // -----------------------------------------------------------
5 | "use strict";
6 |
7 | var debugging = false;
8 |
9 | var fs = require('fs');
10 | var cp = require('child_process');
11 | var path = require('path');
12 |
13 | var webSharedPath = '../web/src/x-shared/';
14 | var nativescriptSharedPath = '../nativescript/app/x-shared/';
15 | var sharedAppPath = '../x-shared/';
16 |
17 | // Root SymLink Code for Windows
18 | if (process.argv.length > 2) {
19 | if (process.argv[2] === 'symlink') {
20 | createRootSymLink();
21 | console.log("Created Symlink");
22 | }
23 | return 0;
24 | }
25 |
26 | console.log("Configuring...");
27 |
28 | // remove previous symlinks if they exist
29 | try {
30 | if (fs.existsSync(resolve(nativescriptSharedPath))) {
31 | fs.unlinkSync(resolve(nativescriptSharedPath));
32 | }
33 |
34 | if (fs.existsSync(resolve(webSharedPath))) {
35 | fs.unlinkSync(resolve(webSharedPath));
36 | }
37 | } catch (err) {
38 | }
39 |
40 | // We need to create a symlink
41 | try {
42 | createSymLink();
43 | } catch (err) {
44 | if (debugging) {
45 | console.log("Symlink error: ", err);
46 | }
47 | // Failed, which means they weren't running root; so lets try to get root
48 | AttemptRootSymlink();
49 | }
50 |
51 | displayFinalHelp();
52 |
53 | if (!fs.existsSync(resolve(nativescriptSharedPath))) {
54 | console.log("We were unable to create a symlink - from -");
55 | console.log(" ", resolve(sharedAppPath), " - to - ");
56 | console.log(" ", resolve(nativescriptSharedPath));
57 | console.log("If you don't create this symlink, you will have to manually copy the code each time you change it.");
58 | }
59 |
60 | if (!fs.existsSync(resolve(webSharedPath))) {
61 | console.log("We were unable to create a symlink - from -");
62 | console.log(" ", resolve(sharedAppPath), " - to - ");
63 | console.log(" ", resolve(webSharedPath));
64 | console.log("If you don't create this symlink, you will have to manually copy the code each time you change it.");
65 | }
66 |
67 | return 0;
68 |
69 | /**
70 | * This will attempt to run the install script as root to make a symlink
71 | */
72 | function AttemptRootSymlink() {
73 |
74 | if (process.platform === 'win32') {
75 | var curPath = resolve("./");
76 | if (debugging) {
77 | console.log("RootSymlink Base path is", curPath);
78 | }
79 | cp.execSync("powershell -Command \"Start-Process 'node' -ArgumentList '"+curPath+"/install.js symlink' -verb runas\"");
80 | } else {
81 | console.log("To automatically create a SymLink between your web app and NativeScript, we need root for a second.");
82 | cp.execSync("sudo "+process.argv[0] + " " + process.argv[1] +" symlink");
83 | }
84 | }
85 |
86 | /**
87 | * Create the symlink when running as root
88 | */
89 | function createRootSymLink() {
90 | var li1 = process.argv[1].lastIndexOf('\\'), li2 = process.argv[1].lastIndexOf('/');
91 | if (li2 > li1) { li1 = li2; }
92 | var AppPath = process.argv[1].substring(0,li1);
93 | var p1 = resolve(AppPath + "/" + nativescriptAppPath);
94 | var p2 = resolve(AppPath + "/" + webAppPath);
95 | if (debugging) {
96 | console.log("Path: ", p1, p2);
97 | }
98 | fs.symlinkSync(p2, p1, 'junction');
99 |
100 | p1 = resolve(AppPath + "/" + nativescriptAssetsPath);
101 | p2 = resolve(AppPath + "/" + webAssetsPath);
102 | if (debugging) {
103 | console.log("Path: ", p1, p2);
104 | }
105 | fs.symlinkSync(p2,p1,'junction');
106 | }
107 |
108 | /**
109 | * Create Symlink
110 | */
111 | function createSymLink() {
112 | if (debugging) {
113 | console.log("Attempting to Symlink", sharedAppPath, nativescriptSharedPath);
114 | }
115 | fs.symlinkSync(resolve(sharedAppPath), resolve(nativescriptSharedPath), 'junction');
116 |
117 | if (debugging) {
118 | console.log("Attempting to Symlink", sharedAppPath, webSharedPath);
119 | }
120 | fs.symlinkSync(resolve(sharedAppPath), resolve(webSharedPath), 'junction');
121 | }
122 |
123 | /**
124 | * Display final help screen!
125 | */
126 | function displayFinalHelp() {
127 | console.log("------------------------ Cross Platform Application is Ready to use. ----------------------------");
128 | console.log("");
129 | console.log("Run your web app with:");
130 | console.log(" npm start");
131 | console.log("");
132 | console.log("Run your Mobile app via NativeScript with:");
133 | console.log(" iOS: npm run start.ios");
134 | console.log(" Android: npm run start.android");
135 | console.log("");
136 | console.log("-----------------------------------------------------------------------------------------");
137 | console.log("");
138 | }
139 |
140 | function splitPath(v) {
141 | var x;
142 | if (v.indexOf('/') !== -1) {
143 | x = v.split('/');
144 | } else {
145 | x = v.split("\\");
146 | }
147 | return x;
148 | }
149 |
150 | function resolve(v) {
151 | var cwdPath = splitPath(process.argv[1]);
152 | // Kill the Script name
153 | cwdPath.length = cwdPath.length - 1;
154 |
155 | var resolvePath = splitPath(v);
156 |
157 | // Eliminate a trailing slash/backslash
158 | if (cwdPath[cwdPath.length - 1] === "") { cwdPath.pop(); }
159 |
160 | if (v[0] === '/' || v[0] === "\\") { cwdPath = []; }
161 | for (var i = 0; i < resolvePath.length; i++) {
162 | if (resolvePath[i] === '.' || resolvePath[i] === "") { continue; }
163 | if (resolvePath[i] === '..') { cwdPath.pop(); }
164 | else { cwdPath.push(resolvePath[i]); }
165 | }
166 | if (process.platform === 'win32') {
167 | var winResult = cwdPath.join("\\");
168 | if (winResult[winResult.length - 1] === "\\") { winResult = winResult.substring(0, winResult.length - 1); }
169 | return winResult;
170 | } else {
171 | var result = cwdPath.join('/');
172 | if (result[0] !== '/') { result = '/' + result; }
173 | if (result[result.length - 1] === '/') { result = result.substring(0, result.length - 1); }
174 | return result;
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nativescript Angular Web Starter
2 | A simple starter project to create native mobile and web apps with single shared code base using angular and nativescript.
3 |
4 | [](https://youtu.be/NJ1oOEIdXVk "YouTube demo")
5 |
6 | Check this [Open Souce Cross Platform Quotes Application](https://github.com/shripalsoni04/ngxp-quotes-app) for reference, which is made with the exact same architecture as this starter project.
7 |
8 | ## Prerequisites
9 | 1. Globally installed Nativecript - `npm install -g nativescript`
10 | 2. Globally installed Angular CLI - `npm install -g angular-cli`
11 | 3. Mac OS to build iOS app.
12 |
13 | ## Installation
14 | 1. `git clone https://github.com/shripalsoni04/nativescript-angular-web-starter --depth=1`
15 | 2. `cd nativescript-angular-web-starter`
16 | 3. `npm run ngxp-install`
17 |
18 | ## Run Web application
19 | `npm start` - This will start the application at http://localhost:4200.
20 |
21 | ## Run iOS Application
22 | `npm run start.ios`
23 |
24 | ## Run Android Application
25 | `npm run start.android`
26 |
27 | ## Project Folder Structure
28 | **nativescript**
29 |
30 | This contains a nativescript project for creating Android/iOS applications.
31 |
32 | **tools**
33 |
34 | This contains scripts useful during development.
35 |
36 | **web**
37 |
38 | This contains nothing but a web project created using `angular-cli`.
39 |
40 | **x-shared**
41 |
42 | All the code/assets which are common to both web and nativescript projects resides here. This folder is symlinked to `nativescript/app/x-shared` and `web/src/x-shared` folder. So changes in `x-shared` folder from any of the three locations will get reflected in other two folders.
43 |
44 |
45 | ## Commands
46 | You can execute any valid command of angular-cli from `web/` folder and any valid command of nativescript-cli from `nativescript/` folder.
47 | For convenince below are the commands which you can execute from root directory.
48 |
49 | ### Common
50 | | Command | Description |
51 | |------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
52 | | npm run ngxp-install | Installs dependencies of web and nativescript applications. Creates symlink of x-shared folder in both web and nativescript project. |
53 |
54 | ### Web Application
55 | | Command | Description |
56 | |------------------------|------------------------------------------------------------------------------------------------------------------------------------|
57 | | npm start | Starts web application at http://localhost:4200 |
58 | | npm run start.prod | Starts web application in production mode. Runs uglification and minification. |
59 | | npm run start.aot | Performs AOT for web application templates and starts web application. |
60 | | npm run start.aot.prod | Performs AOT, minification, uglification and starts web application. |
61 | | npm run build | Builds the web application and copy the built project in web/dist folder. |
62 | | npm run build.prod | Builds the web application in production mode and copy the built project in web/dist folder. |
63 | | npm run build.aot | Performs AOT, build the project and then copy the built project in web/dist folder. |
64 | | npm run build.aot.prod | Performs AOT, prepares production build and then copy the built project in web/dist folder. |
65 | | npm test | Runs web application and x-shared unit test cases. It will not generate code coverage report. |
66 | | npm run test-cc | Runs web application and x-shared unit test cases and generates code coverage report. |
67 |
68 |
69 | ### Nativescript Application
70 | | Command | Description |
71 | |--------------------------|------------------------------------------------------------------------------------------------------------------------------------|
72 | | npm run start.ios | Runs application on iOS emulator/device |
73 | | npm run start.android | Runs application on Android emulator/device |
74 |
75 | ## FAQ
76 | ### How to change package/bundle id for Android/iOS apps?
77 | To change the package/bundle id you need to do changes in below files.
78 |
79 | 1. `nativescript/package.json`
80 | - Change `id` property of `nativescript` object as follows:
81 |
82 | ```
83 | "nativescript": {
84 | "id": "com.domain.yourapp"
85 | }
86 | ```
87 |
88 | 2. Open `nativescript/app/App_Resources/Android/app.gradle` file and change `applicationId` as shown below:
89 |
90 | ```
91 | android {
92 | defaultConfig {
93 | ...
94 | applicationId = "com.domain.yourapp"
95 | }
96 | ...
97 | }
98 | ```
99 |
100 | ### How to change Android and iOS Application Display Name?
101 | **For Android**, open `nativescript/app/App_Resources/Android/values/strings.xml` file and write your app name where `Nativescript Angular Web Starter` is written:
102 |
103 | ```
104 |
105 |
106 | Nativescript Angular Web Starter
107 | Nativescript Angular Web Starter
108 |
109 | ```
110 |
111 | **For iOS**, open `nativescript/app/App_Resources/iOS/info.plist` file and change value of `CFBundleDisplayName` and `CFBundleName` to your app name:
112 |
113 | ```
114 |
115 | ...
116 | CFBundleDisplayName
117 | Nativescript Angular Web Starter
118 | CFBundleName
119 | NativescriptAngularWebStarter
120 | ...
121 |
122 | ```
123 | ### How to use angular dependencies from common node_modules folder. (Not tested properly yet!)
124 | Currently you can see that for web project, angular modules are there as dependencies in common package.json and at web/package.json. So currently to update version of angular modules for web project,
125 | you need to update version at both of these package.json files. To avoid this, you can add path mapping in web project's tsconfig.json file as shown below:
126 |
127 | `web/src/tsconfig.json`
128 | ```
129 | "paths": {
130 | "@angular/*": ["../../node_modules/@angular/*"]
131 | }
132 | ```
133 |
134 | Once you add above configuration, the web project will try to find the @angular pacakges from common node_modules folder.
135 |
136 | ## Attributes
137 | 1. [Angular Framework](https://angular.io/)
138 | 2. [Nativescript Framework](http://nativescript.org/)
139 | 3. [Nativescript Core Theme](https://github.com/NativeScript/theme)
140 | 4. [nativescript-swiss-army-knife](https://github.com/TheOriginalJosh/nativescript-swiss-army-knife)
141 | 5. `tools/install.js` from [angular-advanced-seed](https://github.com/NathanWalker/angular-seed-advanced)
142 |
143 | ## Awesome Contributors
144 | [Nathan Walker](https://github.com/NathanWalker)
145 |
146 | [Mathieu Brunot](https://github.com/madmath03)
147 |
--------------------------------------------------------------------------------