2 |
3 |
4 |
5 |
6 |
7 |
Web Development
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |

23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/src/app/components/about/about.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { CosmicServiceService } from './../../services/cosmic-service.service';
3 |
4 | @Component({
5 | selector: 'app-about',
6 | templateUrl: './about.component.html',
7 | styleUrls: ['./about.component.css']
8 | })
9 | export class AboutComponent implements OnInit {
10 | title: any;
11 | content: any;
12 | showLoader: boolean = false;
13 |
14 | constructor(private cosmicService: CosmicServiceService) { }
15 |
16 | ngOnInit() {
17 | this.showLoader = true;
18 | this.cosmicService.getAboutUsData()
19 | .subscribe((res)=>{
20 | var data = JSON.stringify(res);
21 | let datum = JSON.parse(data);
22 | this.title = datum.objects[0].title;
23 | this.content = datum.objects[0].content;
24 | this.showLoader = false;
25 | })
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |

2 |
3 | # Angular Boilerplate
4 | Angular Boilerplate website powered by Angular 7 and [Cosmic JS](https://cosmicjs.com).
5 |
6 | ### [View the demo](https://cosmicjs.com/apps/angular-website-boilerplate)
7 |
8 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.9.
9 |
10 | # Get Started
11 |
12 | ## Running in Production Mode:
13 |
14 | ```
15 | git clone https://github.com/cosmicjs/angular-website-boilerplate
16 | cd angular-website-boilerplate
17 | npm install
18 | npm run build
19 | npm start
20 | visit: http://localhost:5000/
21 | ```
22 |
23 | ## Development Mode
24 |
25 | 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.
26 |
--------------------------------------------------------------------------------
/src/app/components/header/header.component.css:
--------------------------------------------------------------------------------
1 | .jumbotron {
2 | /* background: url(/assets/header.jpeg) no-repeat center top; */
3 | background: #363636e7;
4 | background-size:cover;
5 | border-radius: 0;
6 | margin-bottom:0;
7 | }
8 | .jumbotron h1 {
9 | font-size: 3.5rem;
10 | font-weight: 300;
11 | line-height: 1.2;
12 | color: #fff;
13 | font-weight: bold;
14 | }
15 |
16 | .cntr{text-align: center}
17 |
18 | ul {
19 | list-style-type: none;
20 | margin: 0;
21 | padding: 0;
22 | overflow: hidden;
23 | background-color: #333333;
24 | }
25 |
26 | li {
27 | float: left;
28 | }
29 |
30 | li span {
31 | display: block;
32 | color: white;
33 | text-align: center;
34 | padding: 16px;
35 | text-decoration: none;
36 | }
37 |
38 | li span:hover {
39 | background-color: #111111;
40 | cursor: pointer
41 | }
--------------------------------------------------------------------------------
/src/app/components/home/home.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
{{title}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |

19 |
20 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |

33 |
34 |
35 |
36 |
37 |
40 |
--------------------------------------------------------------------------------
/src/app/components/services/services.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { CosmicServiceService } from './../../services/cosmic-service.service';
3 |
4 | @Component({
5 | selector: 'app-services',
6 | templateUrl: './services.component.html',
7 | styleUrls: ['./services.component.css']
8 | })
9 | export class ServicesComponent implements OnInit {
10 | firstPara: any;
11 | secondPara: any;
12 | showLoader: boolean = false;
13 | constructor(private cosmicService: CosmicServiceService) { }
14 |
15 | ngOnInit() {
16 | this.showLoader = true;
17 | this.cosmicService.getServices()
18 | .subscribe((res)=>{
19 | var data = JSON.stringify(res);
20 | let datum = JSON.parse(data);
21 | this.firstPara = datum.objects[0].metadata['para1'];
22 | this.secondPara = datum.objects[0].metadata['para2'];
23 | this.showLoader = false;
24 | })
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/app/routing/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 | import { HomeComponent } from './../components/home/home.component'
4 | import { ServicesComponent } from './../components/services/services.component'
5 | import { PortfolioComponent } from './../components/portfolio/portfolio.component'
6 | import { AboutComponent } from './../components/about/about.component'
7 | import { ContactComponent } from './../components/contact/contact.component'
8 |
9 | const routes: Routes = [
10 | { path: '', component: HomeComponent },
11 | { path: 'services', component: ServicesComponent },
12 | { path: 'portfolio', component: PortfolioComponent },
13 | { path: 'about', component: AboutComponent },
14 | { path: 'contact', component: ContactComponent },
15 | ];
16 |
17 | @NgModule({
18 | imports: [RouterModule.forRoot(routes)],
19 | exports: [RouterModule]
20 | })
21 | export class AppRoutingModule { }
22 |
--------------------------------------------------------------------------------
/src/app/components/footer/footer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Contact Us
7 | 975 River Side Road
8 | Email: testmail.com@test.com
9 | Phone:+1223445566
10 |
11 |
12 |
Connect with us
13 |

14 |

15 |

16 |

17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | Proudly Powered by Cosmic JS
28 |
29 |
--------------------------------------------------------------------------------
/src/app/components/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { CosmicServiceService } from './../../services/cosmic-service.service';
3 |
4 | @Component({
5 | selector: 'app-home',
6 | templateUrl: './home.component.html',
7 | styleUrls: ['./home.component.css']
8 | })
9 | export class HomeComponent implements OnInit {
10 | title: any;
11 | content: any;
12 | firstPara: any;
13 | secondPara: any;
14 | showLoader: boolean = false;
15 |
16 | constructor(private cosmicService: CosmicServiceService) { }
17 |
18 | ngOnInit() {
19 | this.showLoader = true;
20 | this.cosmicService.getHomeData()
21 | .subscribe((res)=>{
22 | var data = JSON.stringify(res);
23 | let datum = JSON.parse(data)
24 | console.log(datum.objects[0].metadata['para1'])
25 | this.title = datum.objects[0].title;
26 | this.content = datum.objects[0].content;
27 | this.firstPara = datum.objects[0].metadata['para1'];
28 | this.secondPara = datum.objects[0].metadata['para2'];
29 | this.showLoader = false;
30 | })
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage/angular-boilerplate'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/src/app/components/contact/contact.component.html:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { RouterTestingModule } from '@angular/router/testing';
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async(() => {
7 | TestBed.configureTestingModule({
8 | imports: [
9 | RouterTestingModule
10 | ],
11 | declarations: [
12 | AppComponent
13 | ],
14 | }).compileComponents();
15 | }));
16 |
17 | it('should create the app', () => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.debugElement.componentInstance;
20 | expect(app).toBeTruthy();
21 | });
22 |
23 | it(`should have as title 'angular-boilerplate'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.debugElement.componentInstance;
26 | expect(app.title).toEqual('angular-boilerplate');
27 | });
28 |
29 | it('should render title in a h1 tag', () => {
30 | const fixture = TestBed.createComponent(AppComponent);
31 | fixture.detectChanges();
32 | const compiled = fixture.debugElement.nativeElement;
33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to angular-boilerplate!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src/app/components/contact/contact.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { FormBuilder, FormGroup, FormControl, Validators} from '@angular/forms';
3 | import { CosmicServiceService } from './../../services/cosmic-service.service';
4 |
5 | @Component({
6 | selector: 'app-contact',
7 | templateUrl: './contact.component.html',
8 | styleUrls: ['./contact.component.css']
9 | })
10 | export class ContactComponent implements OnInit {
11 | contactForm: FormGroup;
12 | clientData: any;
13 | submitMessage: any = '';
14 | showLoader: boolean = false;
15 |
16 | constructor(private fb: FormBuilder, private cosmicService: CosmicServiceService)
17 | {
18 | this.contactForm = this.fb.group({
19 | 'name': [''],
20 | 'email': ['',[Validators.email, Validators.required ]],
21 | 'message': ['']
22 | });
23 | }
24 |
25 | ngOnInit() {
26 |
27 | }
28 |
29 | contactUs()
30 | {
31 | this.showLoader = true;
32 | this.clientData = this.contactForm.value;
33 | this.cosmicService.sendMessage(this.clientData)
34 | .subscribe((res)=>{
35 | this.showLoader = false;
36 | this.submitMessage = " Message sent successfully!"
37 | setTimeout(()=>{ this.submitMessage = '' }, 5000);
38 | })
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 |
4 | import { AppRoutingModule } from './routing/app-routing.module';
5 | import { AppComponent } from './app.component';
6 | import { HomeComponent } from './components/home/home.component';
7 | import { HeaderComponent } from './components/header/header.component';
8 | import { FooterComponent } from './components/footer/footer.component';
9 | import { ServicesComponent } from './components/services/services.component';
10 | import { PortfolioComponent } from './components/portfolio/portfolio.component';
11 | import { AboutComponent } from './components/about/about.component';
12 | import { ContactComponent } from './components/contact/contact.component';
13 | import { HttpClientModule } from '@angular/common/http';
14 | import { ReactiveFormsModule } from '@angular/forms';
15 |
16 | @NgModule({
17 | declarations: [
18 | AppComponent,
19 | HomeComponent,
20 | HeaderComponent,
21 | FooterComponent,
22 | ServicesComponent,
23 | PortfolioComponent,
24 | AboutComponent,
25 | ContactComponent
26 | ],
27 | imports: [
28 | BrowserModule,
29 | AppRoutingModule,
30 | HttpClientModule,
31 | ReactiveFormsModule
32 | ],
33 | providers: [],
34 | bootstrap: [AppComponent]
35 | })
36 | export class AppModule { }
37 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | .margin-tp
3 | {
4 | margin-top: 40px
5 | }
6 |
7 |
8 | /* loader */
9 |
10 | #loader {
11 | position: absolute;
12 | left: 0;
13 | top: 50%;
14 | z-index: 1;
15 | width: 150px;
16 | height: 150px;
17 | margin: -75px 0 0 -75px;
18 | border: 16px solid #f3f3f3;
19 | border-radius: 50%;
20 | border-top: 16px solid #0079dd;
21 | width: 120px;
22 | height: 120px;
23 | -webkit-animation: spin 2s linear infinite;
24 | animation: spin 2s linear infinite;
25 | margin: auto;
26 | right: 0;
27 | }
28 |
29 | .is-invisible {
30 | display: none;
31 | }
32 |
33 | .is-visible {
34 | display: block;
35 | }
36 |
37 | .overlay {
38 | position: fixed;
39 | width: 100%;
40 | height: 100%;
41 | top: 0;
42 | left: 0;
43 | right: 0;
44 | background-color: rgba(0, 0, 0, 0.5);
45 | }
46 |
47 | .logoutConfirmed {
48 | margin-right: 10px;
49 | }
50 | .confirm-float{
51 | float:right
52 | }
53 |
54 | @-webkit-keyframes spin {
55 | 0% {
56 | -webkit-transform: rotate(0deg);
57 | }
58 | 100% {
59 | -webkit-transform: rotate(360deg);
60 | }
61 | }
62 | @keyframes spin {
63 | 0% {
64 | transform: rotate(0deg);
65 | }
66 | 100% {
67 | transform: rotate(360deg);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-boilerplate",
3 | "version": "0.0.0",
4 | "engines": {
5 | "npm": "5.7.1",
6 | "node": "9.5.0"
7 | },
8 | "scripts": {
9 | "ng": "ng",
10 | "start": "node server.js",
11 | "build": "ng build --prod",
12 | "test": "ng test",
13 | "lint": "ng lint",
14 | "e2e": "ng e2e"
15 | },
16 | "private": true,
17 | "dependencies": {
18 | "@angular/animations": "~7.2.0",
19 | "@angular/common": "~7.2.0",
20 | "@angular/compiler": "~7.2.0",
21 | "@angular/core": "~7.2.0",
22 | "@angular/forms": "~7.2.0",
23 | "@angular/platform-browser": "~7.2.0",
24 | "@angular/platform-browser-dynamic": "~7.2.0",
25 | "@angular/router": "~7.2.0",
26 | "core-js": "^2.5.4",
27 | "ngx-bootstrap": "^5.0.0",
28 | "rxjs": "~6.3.3",
29 | "tslib": "^1.9.0",
30 | "zone.js": "~0.8.26"
31 | },
32 | "devDependencies": {
33 | "@angular-devkit/build-angular": "~0.13.0",
34 | "@angular/cli": "~7.3.9",
35 | "@angular/compiler-cli": "~7.2.0",
36 | "@angular/language-service": "~7.2.0",
37 | "@types/node": "~8.9.4",
38 | "@types/jasmine": "~2.8.8",
39 | "@types/jasminewd2": "~2.0.3",
40 | "codelyzer": "~4.5.0",
41 | "jasmine-core": "~2.99.1",
42 | "jasmine-spec-reporter": "~4.2.1",
43 | "karma": "~4.0.0",
44 | "karma-chrome-launcher": "~2.2.0",
45 | "karma-coverage-istanbul-reporter": "~2.0.1",
46 | "karma-jasmine": "~1.1.2",
47 | "karma-jasmine-html-reporter": "^0.2.2",
48 | "protractor": "~5.4.0",
49 | "ts-node": "~7.0.0",
50 | "tslint": "~5.11.0",
51 | "typescript": "~3.2.2"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/app/services/cosmic-service.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { config } from './../../config/config';
3 | import { HttpClient } from '@angular/common/http';
4 |
5 |
6 | @Injectable({
7 | providedIn: 'root'
8 | })
9 | export class CosmicServiceService {
10 |
11 | constructor(private _http: HttpClient) { }
12 |
13 | //getting data for home component
14 | getHomeData()
15 | {
16 | return this._http.get(config.url + config.bucket_slug + "/object-type/homes", {
17 | params: {
18 | read_key: config.read_key,
19 | }
20 | })
21 | }
22 |
23 | // get data of services
24 | getServices()
25 | {
26 | return this._http.get(config.url + config.bucket_slug + "/object-type/services", {
27 | params: {
28 | read_key: config.read_key,
29 | }
30 | })
31 | }
32 |
33 | //about us data
34 | getAboutUsData()
35 | {
36 | return this._http.get(config.url + config.bucket_slug + "/object-type/abouts", {
37 | params: {
38 | read_key: config.read_key,
39 | }
40 | })
41 | }
42 |
43 | //send message
44 | sendMessage(data: any)
45 | {
46 | return this._http.post(config.url + config.bucket_slug + "/add-object/",{
47 | title: data.email, content: data.message, slug: data.name, type_slug: 'clients', write_key: config.write_key,
48 |
49 | metafields: [
50 | {
51 | key: "name",
52 | type: "text",
53 | value: data.name
54 | },
55 | {
56 | key: "email",
57 | type: "text",
58 | value: data.email
59 | }
60 | ]
61 |
62 | })
63 | }
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:recommended",
3 | "rulesDirectory": [
4 | "codelyzer"
5 | ],
6 | "rules": {
7 | "array-type": false,
8 | "arrow-parens": false,
9 | "deprecation": {
10 | "severity": "warn"
11 | },
12 | "import-blacklist": [
13 | true,
14 | "rxjs/Rx"
15 | ],
16 | "interface-name": false,
17 | "max-classes-per-file": false,
18 | "max-line-length": [
19 | true,
20 | 140
21 | ],
22 | "member-access": false,
23 | "member-ordering": [
24 | true,
25 | {
26 | "order": [
27 | "static-field",
28 | "instance-field",
29 | "static-method",
30 | "instance-method"
31 | ]
32 | }
33 | ],
34 | "no-consecutive-blank-lines": false,
35 | "no-console": [
36 | true,
37 | "debug",
38 | "info",
39 | "time",
40 | "timeEnd",
41 | "trace"
42 | ],
43 | "no-empty": false,
44 | "no-inferrable-types": [
45 | true,
46 | "ignore-params"
47 | ],
48 | "no-non-null-assertion": true,
49 | "no-redundant-jsdoc": true,
50 | "no-switch-case-fall-through": true,
51 | "no-use-before-declare": true,
52 | "no-var-requires": false,
53 | "object-literal-key-quotes": [
54 | true,
55 | "as-needed"
56 | ],
57 | "object-literal-sort-keys": false,
58 | "ordered-imports": false,
59 | "quotemark": [
60 | true,
61 | "single"
62 | ],
63 | "trailing-comma": false,
64 | "no-output-on-prefix": true,
65 | "use-input-property-decorator": true,
66 | "use-output-property-decorator": true,
67 | "use-host-property-decorator": true,
68 | "no-input-rename": true,
69 | "no-output-rename": true,
70 | "use-life-cycle-interface": true,
71 | "use-pipe-transform-interface": true,
72 | "component-class-suffix": true,
73 | "directive-class-suffix": true
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
22 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
23 |
24 | /**
25 | * Web Animations `@angular/platform-browser/animations`
26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
28 | */
29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
30 |
31 | /**
32 | * By default, zone.js will patch all possible macroTask and DomEvents
33 | * user can disable parts of macroTask/DomEvents patch by setting following flags
34 | * because those flags need to be set before `zone.js` being loaded, and webpack
35 | * will put import in the top of bundle, so user need to create a separate file
36 | * in this directory (for example: zone-flags.ts), and put the following flags
37 | * into that file, and then add the following code before importing zone.js.
38 | * import './zone-flags.ts';
39 | *
40 | * The flags allowed in zone-flags.ts are listed here.
41 | *
42 | * The following flags will work for all browsers.
43 | *
44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47 | *
48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
50 | *
51 | * (window as any).__Zone_enable_cross_context_check = true;
52 | *
53 | */
54 |
55 | /***************************************************************************************************
56 | * Zone JS is required by default for Angular itself.
57 | */
58 | import 'zone.js/dist/zone'; // Included with Angular CLI.
59 |
60 |
61 | /***************************************************************************************************
62 | * APPLICATION IMPORTS
63 | */
64 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "angular-boilerplate": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {},
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:browser",
15 | "options": {
16 | "outputPath": "dist/angular-boilerplate",
17 | "index": "src/index.html",
18 | "main": "src/main.ts",
19 | "polyfills": "src/polyfills.ts",
20 | "tsConfig": "src/tsconfig.app.json",
21 | "assets": [
22 | "src/favicon.ico",
23 | "src/assets"
24 | ],
25 | "styles": [
26 | "src/styles.css"
27 | ],
28 | "scripts": [],
29 | "es5BrowserSupport": true
30 | },
31 | "configurations": {
32 | "production": {
33 | "fileReplacements": [
34 | {
35 | "replace": "src/environments/environment.ts",
36 | "with": "src/environments/environment.prod.ts"
37 | }
38 | ],
39 | "optimization": true,
40 | "outputHashing": "all",
41 | "sourceMap": false,
42 | "extractCss": true,
43 | "namedChunks": false,
44 | "aot": true,
45 | "extractLicenses": true,
46 | "vendorChunk": false,
47 | "buildOptimizer": true,
48 | "budgets": [
49 | {
50 | "type": "initial",
51 | "maximumWarning": "2mb",
52 | "maximumError": "5mb"
53 | }
54 | ]
55 | }
56 | }
57 | },
58 | "serve": {
59 | "builder": "@angular-devkit/build-angular:dev-server",
60 | "options": {
61 | "browserTarget": "angular-boilerplate:build"
62 | },
63 | "configurations": {
64 | "production": {
65 | "browserTarget": "angular-boilerplate:build:production"
66 | }
67 | }
68 | },
69 | "extract-i18n": {
70 | "builder": "@angular-devkit/build-angular:extract-i18n",
71 | "options": {
72 | "browserTarget": "angular-boilerplate:build"
73 | }
74 | },
75 | "test": {
76 | "builder": "@angular-devkit/build-angular:karma",
77 | "options": {
78 | "main": "src/test.ts",
79 | "polyfills": "src/polyfills.ts",
80 | "tsConfig": "src/tsconfig.spec.json",
81 | "karmaConfig": "src/karma.conf.js",
82 | "styles": [
83 | "src/styles.css"
84 | ],
85 | "scripts": [],
86 | "assets": [
87 | "src/favicon.ico",
88 | "src/assets"
89 | ]
90 | }
91 | },
92 | "lint": {
93 | "builder": "@angular-devkit/build-angular:tslint",
94 | "options": {
95 | "tsConfig": [
96 | "src/tsconfig.app.json",
97 | "src/tsconfig.spec.json"
98 | ],
99 | "exclude": [
100 | "**/node_modules/**"
101 | ]
102 | }
103 | }
104 | }
105 | },
106 | "angular-boilerplate-e2e": {
107 | "root": "e2e/",
108 | "projectType": "application",
109 | "prefix": "",
110 | "architect": {
111 | "e2e": {
112 | "builder": "@angular-devkit/build-angular:protractor",
113 | "options": {
114 | "protractorConfig": "e2e/protractor.conf.js",
115 | "devServerTarget": "angular-boilerplate:serve"
116 | },
117 | "configurations": {
118 | "production": {
119 | "devServerTarget": "angular-boilerplate:serve:production"
120 | }
121 | }
122 | },
123 | "lint": {
124 | "builder": "@angular-devkit/build-angular:tslint",
125 | "options": {
126 | "tsConfig": "e2e/tsconfig.e2e.json",
127 | "exclude": [
128 | "**/node_modules/**"
129 | ]
130 | }
131 | }
132 | }
133 | }
134 | },
135 | "defaultProject": "angular-boilerplate"
136 | }
--------------------------------------------------------------------------------