├── src
├── assets
│ └── .gitkeep
├── app
│ ├── app.component.less
│ ├── step1
│ │ ├── step1.component.less
│ │ ├── step1.component.html
│ │ ├── step1.component.ts
│ │ └── step1.component.spec.ts
│ ├── step2
│ │ ├── step2.component.less
│ │ ├── step2.component.html
│ │ ├── step2.component.ts
│ │ └── step2.component.spec.ts
│ ├── step3
│ │ ├── step3.component.less
│ │ ├── step3.component.spec.ts
│ │ ├── step3.component.html
│ │ └── step3.component.ts
│ ├── addqueen
│ │ ├── addqueen.component.less
│ │ ├── addqueen.component.html
│ │ ├── addqueen.component.ts
│ │ └── addqueen.component.spec.ts
│ ├── common
│ │ ├── dependent
│ │ │ ├── dependent.component.less
│ │ │ ├── dependent.component.html
│ │ │ ├── dependent.component.spec.ts
│ │ │ └── dependent.component.ts
│ │ ├── type-ahead
│ │ │ ├── type-ahead.component.less
│ │ │ ├── type-ahead.component.html
│ │ │ ├── type-ahead.component.spec.ts
│ │ │ └── type-ahead.component.ts
│ │ ├── personal-information
│ │ │ ├── personal-information.component.less
│ │ │ ├── personal-information.component.ts
│ │ │ ├── personal-information.component.html
│ │ │ └── personal-information.component.spec.ts
│ │ ├── address
│ │ │ ├── address.component.less
│ │ │ ├── address.component.ts
│ │ │ ├── address.component.html
│ │ │ └── address.component.spec.ts
│ │ ├── season.service.spec.ts
│ │ └── season.service.ts
│ ├── app.component.html
│ ├── prettyprint.pipe.spec.ts
│ ├── app.component.ts
│ ├── prettyprint.pipe.ts
│ ├── span-form
│ │ ├── span-form.component.less
│ │ ├── span-form.component.html
│ │ ├── span-form.component.spec.ts
│ │ └── span-form.component.ts
│ ├── app-routing.module.ts
│ ├── app.component.spec.ts
│ └── app.module.ts
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── tsconfig.app.json
├── tslint.json
├── tsconfig.spec.json
├── main.ts
├── browserslist
├── index.html
├── test.ts
├── styles.less
├── karma.conf.js
└── polyfills.ts
├── e2e
├── tsconfig.e2e.json
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
└── protractor.conf.js
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── README.md
├── package.json
├── tslint.json
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/step1/step1.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/step2/step2.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/step3/step3.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/addqueen/addqueen.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/common/dependent/dependent.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/common/type-ahead/type-ahead.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/common/personal-information/personal-information.component.less:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tehfedaykin/ControlContainerExample/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/app/common/address/address.component.less:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | border: solid 1px #106aa1;
4 | background: #61849b;
5 | padding: 10px;
6 | }
--------------------------------------------------------------------------------
/src/app/step2/step2.component.html:
--------------------------------------------------------------------------------
1 |
Step Two of Our Sign-in Process
2 |
3 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 | Basically Myspace for Drag Race Fans
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/prettyprint.pipe.spec.ts:
--------------------------------------------------------------------------------
1 | import { PrettyprintPipe } from './prettyprint.pipe';
2 |
3 | describe('PrettyprintPipe', () => {
4 | it('create an instance', () => {
5 | const pipe = new PrettyprintPipe();
6 | expect(pipe).toBeTruthy();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/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.less']
7 | })
8 | export class AppComponent {
9 | title = 'controlcontainer';
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get(browser.baseUrl) as Promise;
6 | }
7 |
8 | getTitleText() {
9 | return element(by.css('app-root h1')).getText() as Promise;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/app/prettyprint.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'prettyprint'
5 | })
6 | export class PrettyPrintPipe implements PipeTransform {
7 | transform(val) {
8 | return JSON.stringify(val, null, 2)
9 | .replace(' ', ' ')
10 | .replace('\n', '
');
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/step1/step1.component.html:
--------------------------------------------------------------------------------
1 | Step One of Our Sign-in Process
2 |
8 |
--------------------------------------------------------------------------------
/src/app/common/type-ahead/type-ahead.component.html:
--------------------------------------------------------------------------------
1 |
2 | {{model.name}}
3 |
4 |
14 |
--------------------------------------------------------------------------------
/src/app/common/season.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { SeasonService } from './season.service';
4 |
5 | describe('SeasonService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: SeasonService = TestBed.get(SeasonService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/src/app/addqueen/addqueen.component.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/src/app/span-form/span-form.component.less:
--------------------------------------------------------------------------------
1 | :host {
2 | border: solid 2px rgb(220, 42, 140);
3 | margin: 10px;
4 | padding: 10px;
5 | display: block;
6 | .content {
7 | display: flex;
8 | flex-direction: row;
9 | .form-ui {
10 | flex: 1;
11 | padding: 20px;
12 | margin: 20px;
13 | border: solid 2px #691191;
14 | background: #926ea3;
15 | }
16 | .form-value {
17 | border: solid 2px #89d319;
18 | background: #c3daa1;
19 | }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "target": "es5",
14 | "typeRoots": [
15 | "node_modules/@types"
16 | ],
17 | "lib": [
18 | "es2018",
19 | "dom"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Controlcontainer
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/app/step1/step1.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ControlContainer } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-step1',
6 | templateUrl: './step1.component.html',
7 | styleUrls: ['./step1.component.less']
8 | })
9 | export class Step1Component implements OnInit {
10 | public parentForm;
11 | constructor(private parentControl: ControlContainer) {
12 | }
13 |
14 | ngOnInit() {
15 | this.parentForm = this.parentControl.control;
16 | console.log('step 1', this.parentControl);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/common/address/address.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ControlContainer } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-address',
6 | templateUrl: './address.component.html',
7 | styleUrls: ['./address.component.less']
8 | })
9 | export class AddressComponent implements OnInit {
10 | public addressFormGroup;
11 | constructor(private controlContainer: ControlContainer) {
12 | }
13 |
14 | ngOnInit() {
15 | this.addressFormGroup = this.controlContainer.control.get('address');
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/step2/step2.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Host } from '@angular/core';
2 | import { ControlContainer, FormGroup } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-step2',
6 | templateUrl: './step2.component.html',
7 | styleUrls: ['./step2.component.less']
8 | })
9 | export class Step2Component implements OnInit {
10 | public parentForm;
11 |
12 | constructor(private parentFormControl: ControlContainer) {
13 | }
14 |
15 | ngOnInit() {
16 | this.parentForm = this.parentFormControl.control;
17 | console.log('step 2', this.parentForm);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/app/common/address/address.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/common/personal-information/personal-information.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ControlContainer } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-personal-information',
6 | templateUrl: './personal-information.component.html',
7 | styleUrls: ['./personal-information.component.less']
8 | })
9 | export class PersonalInformationComponent implements OnInit {
10 | public addressFormGroup;
11 | constructor(private controlContainer: ControlContainer) {
12 | }
13 |
14 | ngOnInit() {
15 | this.addressFormGroup = this.controlContainer.control.get('address');
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/common/personal-information/personal-information.component.html:
--------------------------------------------------------------------------------
1 | Some basic personal information
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/app/span-form/span-form.component.html:
--------------------------------------------------------------------------------
1 | Parent Component with Form Views
2 | I hold the main form.
3 |
--------------------------------------------------------------------------------
/src/app/addqueen/addqueen.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { FormArray, FormGroup, FormControl } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-addqueen',
6 | templateUrl: './addqueen.component.html',
7 | styleUrls: ['./addqueen.component.less']
8 | })
9 | export class AddqueenComponent implements OnInit {
10 | public myQueens: FormArray;
11 | constructor() { }
12 |
13 | ngOnInit() {
14 | this.myQueens = new FormArray([
15 | new FormGroup({
16 | name: new FormControl(''),
17 | season: new FormControl('')
18 | })
19 | ])
20 | }
21 |
22 | removeGroup(i) {
23 | this.myQueens.removeAt(i)
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/app/common/dependent/dependent.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
17 |
18 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 | import { browser, logging } from 'protractor';
3 |
4 | describe('workspace-project App', () => {
5 | let page: AppPage;
6 |
7 | beforeEach(() => {
8 | page = new AppPage();
9 | });
10 |
11 | it('should display welcome message', () => {
12 | page.navigateTo();
13 | expect(page.getTitleText()).toEqual('Welcome to controlcontainer!');
14 | });
15 |
16 | afterEach(async () => {
17 | // Assert that there are no errors emitted from the browser
18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19 | expect(logs).not.toContain(jasmine.objectContaining({
20 | level: logging.Level.SEVERE,
21 | } as logging.Entry));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/src/app/step1/step1.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { Step1Component } from './step1.component';
4 |
5 | describe('Step1Component', () => {
6 | let component: Step1Component;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ Step1Component ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(Step1Component);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/step2/step2.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { Step2Component } from './step2.component';
4 |
5 | describe('Step2Component', () => {
6 | let component: Step2Component;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ Step2Component ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(Step2Component);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/step3/step3.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { Step3Component } from './step3.component';
4 |
5 | describe('Step3Component', () => {
6 | let component: Step3Component;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ Step3Component ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(Step3Component);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/addqueen/addqueen.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { AddqueenComponent } from './addqueen.component';
4 |
5 | describe('AddqueenComponent', () => {
6 | let component: AddqueenComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ AddqueenComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(AddqueenComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/common/address/address.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { AddressComponent } from './address.component';
4 |
5 | describe('AddressComponent', () => {
6 | let component: AddressComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ AddressComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(AddressComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/span-form/span-form.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { SpanFormComponent } from './span-form.component';
4 |
5 | describe('SpanFormComponent', () => {
6 | let component: SpanFormComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ SpanFormComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(SpanFormComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/common/dependent/dependent.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { DependentComponent } from './dependent.component';
4 |
5 | describe('DependentComponent', () => {
6 | let component: DependentComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ DependentComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(DependentComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/common/type-ahead/type-ahead.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { TypeAheadComponent } from './type-ahead.component';
4 |
5 | describe('TypeAheadComponent', () => {
6 | let component: TypeAheadComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ TypeAheadComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(TypeAheadComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/styles.less:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
3 | input, select, textarea {
4 | &.ng-invalid.ng-touched {
5 | border: solid 3px red;
6 | }
7 | }
8 | .form-group {
9 | margin: 10px;
10 | label {
11 | margin-right: 10px;
12 | }
13 | }
14 |
15 | .form-group {
16 | .ng-valid[required], .ng-valid.required {
17 | border-left: 5px solid #42A948; /* green */
18 | }
19 | .ng-touched.ng-invalid:not(form) {
20 | border-left: 5px solid #a94442; /* red */
21 | }
22 | }
23 |
24 | .form-control {
25 | border-radius: 0px;
26 | }
27 | html, body { height: 100%; }
28 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
29 |
30 | @import '~bootstrap/dist/css/bootstrap.min.css';
31 | @import '~ngx-bootstrap/datepicker/bs-datepicker.css';
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events.json
15 | speed-measure-plugin.json
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 |
26 | # IDE - VSCode
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 | .history/*
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/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/common/personal-information/personal-information.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2 |
3 | import { PersonalInformationComponent } from './personal-information.component';
4 |
5 | describe('PersonalInformationComponent', () => {
6 | let component: PersonalInformationComponent;
7 | let fixture: ComponentFixture;
8 |
9 | beforeEach(async(() => {
10 | TestBed.configureTestingModule({
11 | declarations: [ PersonalInformationComponent ]
12 | })
13 | .compileComponents();
14 | }));
15 |
16 | beforeEach(() => {
17 | fixture = TestBed.createComponent(PersonalInformationComponent);
18 | component = fixture.componentInstance;
19 | fixture.detectChanges();
20 | });
21 |
22 | it('should create', () => {
23 | expect(component).toBeTruthy();
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { Routes, RouterModule } from '@angular/router';
3 | import { SpanFormComponent } from './span-form/span-form.component';
4 | import { Step1Component } from './step1/step1.component';
5 | import { Step2Component } from './step2/step2.component';
6 | import { Step3Component } from './step3/step3.component';
7 |
8 | const routes: Routes = [
9 | {
10 | path: 'signup',
11 | component: SpanFormComponent,
12 | children: [
13 | {
14 | path: 'step-1',
15 | component: Step1Component
16 | },
17 | {
18 | path: 'step-2',
19 | component: Step2Component
20 | },
21 | {
22 | path: 'step-3',
23 | component: Step3Component
24 | }
25 | ]
26 | }
27 | ];
28 |
29 | @NgModule({
30 | imports: [RouterModule.forRoot(routes)],
31 | exports: [RouterModule]
32 | })
33 | export class AppRoutingModule { }
34 |
--------------------------------------------------------------------------------
/src/app/common/dependent/dependent.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { SeasonService, Iseason, Iepisode } from '../season.service';
3 | import { Observable } from 'rxjs';
4 | import { mergeMap } from 'rxjs/operators';
5 | import { ControlContainer } from '@angular/forms';
6 |
7 | @Component({
8 | selector: 'app-dependent',
9 | templateUrl: './dependent.component.html',
10 | styleUrls: ['./dependent.component.less']
11 | })
12 | export class DependentComponent implements OnInit {
13 | seasons$: Observable;
14 | episodes$: Observable;
15 | constructor(
16 | private seasonService: SeasonService,
17 | public controlContainer: ControlContainer
18 | ) { }
19 |
20 | ngOnInit() {
21 | this.seasons$ = this.seasonService.getSeasons();
22 | let seasonCtrl = this.controlContainer.control.get('favorite_season');
23 | this.episodes$ = seasonCtrl.valueChanges.pipe(
24 | mergeMap((seasonId: number) => {
25 | return this.seasonService.getSeasonEpisodes(seasonId);
26 | })
27 | )
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Controlcontainer
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.9.
4 |
5 | ## Development server
6 |
7 | 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.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | 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.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | 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).
28 |
--------------------------------------------------------------------------------
/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/controlcontainer'),
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/common/season.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 | import { HttpClient } from '@angular/common/http';
3 |
4 | export interface Iqueen {
5 | id: number;
6 | name: string;
7 | place: number;
8 | }
9 | export interface Iseason {
10 | id: number;
11 | seasonNumber: string;
12 | winnerId: number;
13 | image_url: string;
14 | queens: Iqueen[];
15 | }
16 |
17 | export interface Iepisode {
18 | id: number;
19 | title: string;
20 | episodeInSeason: number;
21 | seasonId: number;
22 | airDate: Date;
23 | }
24 |
25 | @Injectable({
26 | providedIn: 'root'
27 | })
28 | export class SeasonService {
29 |
30 | constructor(private http: HttpClient) { }
31 |
32 | getSeasons() {
33 | return this.http.get(`http://www.nokeynoshade.party/api/seasons`);
34 | }
35 |
36 | getSeasonEpisodes(seasonId: number) {
37 | return this.http.get(`http://www.nokeynoshade.party/api/seasons/${seasonId}/episodes`)
38 | }
39 |
40 | getQueens() {
41 | return this.http.get(`http://www.nokeynoshade.party/api/queens/all`);
42 | }
43 |
44 | getLipsyncs() {
45 | return this.http.get(`http://www.nokeynoshade.party/api/lipsyncs`);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/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 'controlcontainer'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.debugElement.componentInstance;
26 | expect(app.title).toEqual('controlcontainer');
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 controlcontainer!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src/app/step3/step3.component.html:
--------------------------------------------------------------------------------
1 | Step Three of Our Sign-in Process
2 |
--------------------------------------------------------------------------------
/src/app/step3/step3.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { ControlContainer, FormGroup, FormControl } from '@angular/forms';
3 | import { SeasonService, Iqueen } from '../common/season.service';
4 | import { Observable } from 'rxjs';
5 |
6 | @Component({
7 | selector: 'app-step3',
8 | templateUrl: './step3.component.html',
9 | styleUrls: ['./step3.component.less']
10 | })
11 | export class Step3Component implements OnInit {
12 | public parentForm;
13 | public queens$: Observable;
14 | public lipsyncs$: Observable;
15 | public lipSyncFormArray;
16 |
17 | constructor(
18 | private parentFormControl: ControlContainer,
19 | private seasonService: SeasonService
20 | ) {
21 | }
22 |
23 | ngOnInit() {
24 | this.parentForm = this.parentFormControl.control;
25 | this.lipSyncFormArray = this.parentForm.get('favorite_lipsyncs');
26 | console.log('queens', this.lipSyncFormArray);
27 | this.queens$ = this.seasonService.getQueens();
28 |
29 | this.lipsyncs$ = this.seasonService.getLipsyncs();
30 | }
31 |
32 | removeLipsync(i) {
33 | this.lipSyncFormArray.removeAt(i)
34 | }
35 |
36 | addLipsync() {
37 | let length = this.lipSyncFormArray.controls.length;
38 | console.log('len', length);
39 | this.lipSyncFormArray.insert(length, new FormGroup({
40 | lipsync: new FormControl(''),
41 | ranking: new FormControl('0')
42 | }))
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "controlcontainer",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e"
11 | },
12 | "private": true,
13 | "dependencies": {
14 | "@angular/animations": "~7.2.0",
15 | "@angular/cdk": "~7.3.7",
16 | "@angular/common": "~7.2.0",
17 | "@angular/compiler": "~7.2.0",
18 | "@angular/core": "~7.2.0",
19 | "@angular/forms": "~7.2.0",
20 | "@angular/material": "^7.3.7",
21 | "@angular/platform-browser": "~7.2.0",
22 | "@angular/platform-browser-dynamic": "~7.2.0",
23 | "@angular/router": "~7.2.0",
24 | "bootstrap": "4.1.1",
25 | "core-js": "^2.5.4",
26 | "ngx-bootstrap": "^5.2.0",
27 | "rxjs": "~6.3.3",
28 | "tslib": "^1.9.0",
29 | "zone.js": "~0.8.26"
30 | },
31 | "devDependencies": {
32 | "@angular-devkit/build-angular": "~0.13.0",
33 | "@angular/cli": "~7.3.9",
34 | "@angular/compiler-cli": "~7.2.0",
35 | "@angular/language-service": "~7.2.0",
36 | "@types/node": "~8.9.4",
37 | "@types/jasmine": "~2.8.8",
38 | "@types/jasminewd2": "~2.0.3",
39 | "codelyzer": "~4.5.0",
40 | "jasmine-core": "~2.99.1",
41 | "jasmine-spec-reporter": "~4.2.1",
42 | "karma": "~4.0.0",
43 | "karma-chrome-launcher": "~2.2.0",
44 | "karma-coverage-istanbul-reporter": "~2.0.1",
45 | "karma-jasmine": "~1.1.2",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.4.0",
48 | "ts-node": "~7.0.0",
49 | "tslint": "~5.11.0",
50 | "typescript": "~3.2.2"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/app/common/type-ahead/type-ahead.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit, Input, forwardRef } from '@angular/core';
2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3 | import { tap, distinctUntilChanged, map } from 'rxjs/operators';
4 | import { Observable } from 'rxjs';
5 |
6 | @Component({
7 | selector: 'app-typeahead',
8 | templateUrl: './type-ahead.component.html',
9 | styleUrls: ['./type-ahead.component.less'],
10 | providers: [
11 | {
12 | provide: NG_VALUE_ACCESSOR,
13 | useExisting: forwardRef(() => TypeAheadComponent),
14 | multi: true
15 | }
16 | ]
17 | })
18 | export class TypeAheadComponent implements ControlValueAccessor {
19 | @Input() data;
20 | public selected;
21 | public value;
22 | constructor() { }
23 |
24 | onChange: any = () => { };
25 | onTouched: any = () => { };
26 |
27 | registerOnChange( fn : any ) : void {
28 | this.onChange = fn;
29 | }
30 |
31 | registerOnTouched( fn : any ) : void {
32 | this.onTouched = fn;
33 | }
34 |
35 | writeValue(value) {
36 | this.value = value;
37 | this.selectDropdown(value);
38 | }
39 |
40 | selectDropdown(val) {
41 | //display current value in typeahead
42 | if (val != undefined && val != '') {
43 | if (this.value && this.data) {
44 | this.selected = this.data.filter(x => x.id == val)[0] ? this.data.filter((x) => {
45 | return x.id == val
46 | })[0].name : '';
47 | }
48 | else {
49 | this.selected = val;
50 | }
51 | }
52 | else {
53 | this.selected = null;
54 | }
55 | }
56 |
57 | onSelect(ev) {
58 | //let the formControl know the value's been changed
59 | this.onChange(ev.item.id);
60 | this.onTouched();
61 | }
62 |
63 | onBlur() {
64 | //let the formControl know it's been touched
65 | this.onTouched();
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/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/app/span-form/span-form.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
3 |
4 | @Component({
5 | selector: 'app-span-form',
6 | templateUrl: './span-form.component.html',
7 | styleUrls: ['./span-form.component.less']
8 | })
9 | export class SpanFormComponent implements OnInit {
10 | public mainForm: FormGroup;
11 | constructor(
12 | private fb: FormBuilder
13 | ) { }
14 |
15 | ngOnInit() {
16 | const control = new FormControl('inital value', {validators: Validators.required})
17 | this.mainForm = this.fb.group({
18 | user_name: ['', Validators.required],
19 | first_name: ['',Validators.required],
20 | last_name: ['',Validators.required],
21 | email: ['',Validators.required],
22 | address: this.fb.group({
23 | street: ['',Validators.required],
24 | city: ['',Validators.required],
25 | state: ['',Validators.required],
26 | zip: ['',Validators.required]
27 | }),
28 | favorite_color: ['',Validators.required],
29 | favorite_food: ['',Validators.required],
30 | favorite_queen: ['80',Validators.required],
31 | favorite_season: ['',Validators.required],
32 | favorite_episode: [''],
33 | favorite_lipsyncs: this.fb.array([
34 | this.fb.group({
35 | lipsync: [''],
36 | ranking: ['']
37 | })
38 | ])
39 | })
40 |
41 | this.mainForm.get('favorite_season').valueChanges.subscribe((val) => {
42 | const favEpControl = this.mainForm.get('favorite_episode');
43 | if(val) {
44 | favEpControl.setValidators(Validators.required);
45 | favEpControl.setValue('59');
46 | }
47 | else {
48 | favEpControl.setValidators(null)
49 | }
50 | favEpControl.updateValueAndValidity();
51 | })
52 | }
53 |
54 | save() {
55 | Object.keys(this.mainForm.controls).forEach((field) => {
56 | const control = this.mainForm.get(field);
57 | control.markAsTouched();
58 | })
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { ReactiveFormsModule, FormsModule } from '@angular/forms';
4 | import { HttpClientModule } from '@angular/common/http';
5 | import { MatToolbarModule } from '@angular/material/toolbar';
6 | import { MatCardModule } from '@angular/material/card';
7 | import { AppRoutingModule } from './app-routing.module';
8 | import { AppComponent } from './app.component';
9 | import { SpanFormComponent } from './span-form/span-form.component';
10 | import { AddressComponent } from './common/address/address.component';
11 | import { DependentComponent } from './common/dependent/dependent.component';
12 | import { PersonalInformationComponent } from './common/personal-information/personal-information.component';
13 | import { Step1Component } from './step1/step1.component';
14 | import { Step2Component } from './step2/step2.component';
15 | import { Step3Component } from './step3/step3.component';
16 | import { NoopAnimationsModule, BrowserAnimationsModule } from '@angular/platform-browser/animations';
17 | import { PrettyPrintPipe } from './prettyprint.pipe';
18 | import { TypeAheadComponent } from './common/type-ahead/type-ahead.component';
19 | import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
20 | import { AddqueenComponent } from './addqueen/addqueen.component';
21 |
22 | @NgModule({
23 | declarations: [
24 | AppComponent,
25 | SpanFormComponent,
26 | AddressComponent,
27 | DependentComponent,
28 | PersonalInformationComponent,
29 | Step1Component,
30 | Step2Component,
31 | Step3Component,
32 | PrettyPrintPipe,
33 | TypeAheadComponent,
34 | AddqueenComponent
35 | ],
36 | imports: [
37 | BrowserModule,
38 | AppRoutingModule,
39 | FormsModule,
40 | ReactiveFormsModule,
41 | HttpClientModule,
42 | NoopAnimationsModule,
43 | MatToolbarModule,
44 | MatCardModule,
45 | TypeaheadModule.forRoot(),
46 | BrowserAnimationsModule
47 | ],
48 | providers: [],
49 | bootstrap: [AppComponent]
50 | })
51 | export class AppModule { }
52 |
--------------------------------------------------------------------------------
/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 | "controlcontainer": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {
12 | "@schematics/angular:component": {
13 | "style": "less"
14 | }
15 | },
16 | "architect": {
17 | "build": {
18 | "builder": "@angular-devkit/build-angular:browser",
19 | "options": {
20 | "outputPath": "dist/controlcontainer",
21 | "index": "src/index.html",
22 | "main": "src/main.ts",
23 | "polyfills": "src/polyfills.ts",
24 | "tsConfig": "src/tsconfig.app.json",
25 | "assets": [
26 | "src/favicon.ico",
27 | "src/assets"
28 | ],
29 | "styles": [
30 | "./node_modules/bootstrap/dist/css/bootstrap.min.css",
31 | "./node_modules/@angular/material/prebuilt-themes/pink-bluegrey.css",
32 | "src/styles.less"
33 | ],
34 | "scripts": [],
35 | "es5BrowserSupport": true
36 | },
37 | "configurations": {
38 | "production": {
39 | "fileReplacements": [
40 | {
41 | "replace": "src/environments/environment.ts",
42 | "with": "src/environments/environment.prod.ts"
43 | }
44 | ],
45 | "optimization": true,
46 | "outputHashing": "all",
47 | "sourceMap": false,
48 | "extractCss": true,
49 | "namedChunks": false,
50 | "aot": true,
51 | "extractLicenses": true,
52 | "vendorChunk": false,
53 | "buildOptimizer": true,
54 | "budgets": [
55 | {
56 | "type": "initial",
57 | "maximumWarning": "2mb",
58 | "maximumError": "5mb"
59 | }
60 | ]
61 | }
62 | }
63 | },
64 | "serve": {
65 | "builder": "@angular-devkit/build-angular:dev-server",
66 | "options": {
67 | "browserTarget": "controlcontainer:build"
68 | },
69 | "configurations": {
70 | "production": {
71 | "browserTarget": "controlcontainer:build:production"
72 | }
73 | }
74 | },
75 | "extract-i18n": {
76 | "builder": "@angular-devkit/build-angular:extract-i18n",
77 | "options": {
78 | "browserTarget": "controlcontainer:build"
79 | }
80 | },
81 | "test": {
82 | "builder": "@angular-devkit/build-angular:karma",
83 | "options": {
84 | "main": "src/test.ts",
85 | "polyfills": "src/polyfills.ts",
86 | "tsConfig": "src/tsconfig.spec.json",
87 | "karmaConfig": "src/karma.conf.js",
88 | "styles": [
89 | "./node_modules/bootstrap/dist/css/bootstrap.min.css",
90 | "./node_modules/@angular/material/prebuilt-themes/pink-bluegrey.css",
91 | "src/styles.less"
92 | ],
93 | "scripts": [],
94 | "assets": [
95 | "src/favicon.ico",
96 | "src/assets"
97 | ]
98 | }
99 | },
100 | "lint": {
101 | "builder": "@angular-devkit/build-angular:tslint",
102 | "options": {
103 | "tsConfig": [
104 | "src/tsconfig.app.json",
105 | "src/tsconfig.spec.json"
106 | ],
107 | "exclude": [
108 | "**/node_modules/**"
109 | ]
110 | }
111 | }
112 | }
113 | },
114 | "controlcontainer-e2e": {
115 | "root": "e2e/",
116 | "projectType": "application",
117 | "prefix": "",
118 | "architect": {
119 | "e2e": {
120 | "builder": "@angular-devkit/build-angular:protractor",
121 | "options": {
122 | "protractorConfig": "e2e/protractor.conf.js",
123 | "devServerTarget": "controlcontainer:serve"
124 | },
125 | "configurations": {
126 | "production": {
127 | "devServerTarget": "controlcontainer:serve:production"
128 | }
129 | }
130 | },
131 | "lint": {
132 | "builder": "@angular-devkit/build-angular:tslint",
133 | "options": {
134 | "tsConfig": "e2e/tsconfig.e2e.json",
135 | "exclude": [
136 | "**/node_modules/**"
137 | ]
138 | }
139 | }
140 | }
141 | }
142 | },
143 | "defaultProject": "controlcontainer"
144 | }
--------------------------------------------------------------------------------