├── src
├── assets
│ └── .gitkeep
├── app
│ ├── some-core-component
│ │ ├── some-core-component.component.scss
│ │ ├── some-core-component.component.html
│ │ ├── some-core-component.component.ts
│ │ └── some-core-component.component.spec.ts
│ ├── app.component.scss
│ ├── app.component.html
│ ├── app-routing.module.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ └── app.component.spec.ts
├── favicon.ico
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── styles.scss
├── tsconfig.spec.json
├── index.html
├── tslint.json
├── main.ts
├── browserslist
├── tsconfig.app.json
├── test.ts
├── karma.conf.js
└── polyfills.ts
├── projects
├── app1
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── app
│ │ │ ├── app.component.css
│ │ │ ├── first
│ │ │ │ ├── first.component.css
│ │ │ │ ├── first.component.html
│ │ │ │ ├── first.component.spec.ts
│ │ │ │ └── first.component.ts
│ │ │ ├── app.component.html
│ │ │ ├── store
│ │ │ │ ├── index.ts
│ │ │ │ └── showHideElement
│ │ │ │ │ ├── hide-show.actions.ts
│ │ │ │ │ ├── hide-show.reducer.ts
│ │ │ │ │ └── hide-show.selectors.ts
│ │ │ ├── app.component.ts
│ │ │ ├── app.module-export.ts
│ │ │ ├── app.component.spec.ts
│ │ │ └── app.module.ts
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── styles.css
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── tsconfig.app.json
│ ├── tslint.json
│ ├── tsconfig.spec.json
│ ├── browserslist
│ └── karma.conf.js
├── app2
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── app
│ │ │ ├── app.component.css
│ │ │ ├── second
│ │ │ │ ├── second.component.css
│ │ │ │ ├── second.component.html
│ │ │ │ ├── second.component.spec.ts
│ │ │ │ └── second.component.ts
│ │ │ ├── app.component.html
│ │ │ ├── store
│ │ │ │ ├── index.ts
│ │ │ │ └── showHideElement
│ │ │ │ │ ├── hide-show.actions.ts
│ │ │ │ │ ├── hide-show.reducer.ts
│ │ │ │ │ └── hide-show.selectors.ts
│ │ │ ├── app.component.ts
│ │ │ ├── app.module-export.ts
│ │ │ ├── app.component.spec.ts
│ │ │ └── app.module.ts
│ │ ├── environments
│ │ │ ├── environment.prod.ts
│ │ │ └── environment.ts
│ │ ├── styles.css
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── main.ts
│ │ ├── test.ts
│ │ └── polyfills.ts
│ ├── tsconfig.app.json
│ ├── tslint.json
│ ├── tsconfig.spec.json
│ ├── browserslist
│ └── karma.conf.js
├── admin-lib
│ ├── package.json
│ ├── ng-package.json
│ ├── src
│ │ ├── lib
│ │ │ ├── admin-lib.service.ts
│ │ │ ├── admin-lib.module.ts
│ │ │ ├── admin-lib.component.ts
│ │ │ ├── admin-lib.service.spec.ts
│ │ │ └── admin-lib.component.spec.ts
│ │ ├── public_api.ts
│ │ └── test.ts
│ ├── tslint.json
│ ├── tsconfig.spec.json
│ ├── tsconfig.lib.json
│ ├── README.md
│ └── karma.conf.js
├── app1-e2e
│ ├── tsconfig.e2e.json
│ ├── src
│ │ ├── app.po.ts
│ │ └── app.e2e-spec.ts
│ └── protractor.conf.js
└── app2-e2e
│ ├── tsconfig.e2e.json
│ ├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
│ └── protractor.conf.js
├── CoreApp-project-structure.gif
├── CoreApp-start_apps_separately.gif
├── e2e
├── tsconfig.e2e.json
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
└── protractor.conf.js
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── tslint.json
├── package.json
├── README.md
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app1/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app2/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app1/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app2/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app1/src/app/first/first.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/projects/app2/src/app/second/second.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/some-core-component/some-core-component.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | a {
2 | padding-left: 12px;
3 | }
4 |
--------------------------------------------------------------------------------
/projects/app1/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/projects/app2/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/projects/app1/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/projects/app1/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/projects/app2/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/projects/app2/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 |
--------------------------------------------------------------------------------
/CoreApp-project-structure.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/CoreApp-project-structure.gif
--------------------------------------------------------------------------------
/projects/app1/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/projects/app1/src/favicon.ico
--------------------------------------------------------------------------------
/projects/app2/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/projects/app2/src/favicon.ico
--------------------------------------------------------------------------------
/CoreApp-start_apps_separately.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kievsash/Core-App-monorepo/HEAD/CoreApp-start_apps_separately.gif
--------------------------------------------------------------------------------
/src/app/some-core-component/some-core-component.component.html:
--------------------------------------------------------------------------------
1 |
2 | some-core-component works!
3 |
4 |
5 |
--------------------------------------------------------------------------------
/projects/admin-lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "admin-lib",
3 | "version": "0.0.1",
4 | "peerDependencies": {
5 | "@angular/common": "^7.2.0",
6 | "@angular/core": "^7.2.0"
7 | }
8 | }
--------------------------------------------------------------------------------
/projects/admin-lib/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/admin-lib",
4 | "lib": {
5 | "entryFile": "src/public_api.ts"
6 | }
7 | }
--------------------------------------------------------------------------------
/projects/admin-lib/src/lib/admin-lib.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | @Injectable({
4 | providedIn: 'root'
5 | })
6 | export class AdminLibService {
7 |
8 | constructor() { }
9 | }
10 |
--------------------------------------------------------------------------------
/projects/admin-lib/src/public_api.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of admin-lib
3 | */
4 |
5 | export * from './lib/admin-lib.service';
6 | export * from './lib/admin-lib.component';
7 | export * from './lib/admin-lib.module';
8 |
--------------------------------------------------------------------------------
/projects/app2/src/app/second/second.component.html:
--------------------------------------------------------------------------------
1 |
2 | App2 works!
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/projects/app1/src/app/store/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import {ShowState} from './showHideElement/hide-show.reducer';
3 |
4 | interface State {
5 | app1ShowHide: ShowState;
6 | }
7 |
8 | export * from './showHideElement/hide-show.selectors';
9 |
10 |
--------------------------------------------------------------------------------
/projects/app1/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 |
--------------------------------------------------------------------------------
/projects/app2/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 |
--------------------------------------------------------------------------------
/projects/app2/src/app/store/index.ts:
--------------------------------------------------------------------------------
1 |
2 | import {showHideReducer, ShowState} from './showHideElement/hide-show.reducer';
3 |
4 | interface App2State {
5 | app2ShowHide: ShowState;
6 | }
7 |
8 | export * from './showHideElement/hide-show.selectors';
9 |
10 |
--------------------------------------------------------------------------------
/projects/app1/src/app/first/first.component.html:
--------------------------------------------------------------------------------
1 |
2 | App1 works!
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/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 | }
--------------------------------------------------------------------------------
/projects/app1/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-app1-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class App1Component {
9 | title = 'app1';
10 | }
11 |
--------------------------------------------------------------------------------
/projects/app2/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-app2-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class App2Component {
9 | title = 'app2';
10 | }
11 |
--------------------------------------------------------------------------------
/projects/app1-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 | }
--------------------------------------------------------------------------------
/projects/app2-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 | }
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/projects/admin-lib/src/lib/admin-lib.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { AdminLibComponent } from './admin-lib.component';
3 |
4 | @NgModule({
5 | declarations: [AdminLibComponent],
6 | imports: [
7 | ],
8 | exports: [AdminLibComponent]
9 | })
10 | export class AdminLibModule { }
11 |
--------------------------------------------------------------------------------
/projects/app1-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 |
--------------------------------------------------------------------------------
/projects/app2-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 |
--------------------------------------------------------------------------------
/projects/app1/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 |
--------------------------------------------------------------------------------
/projects/app2/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 |
--------------------------------------------------------------------------------
/projects/admin-lib/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "lib",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "lib",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/projects/admin-lib/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 | "src/test.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/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/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CoreApp
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/projects/app1/src/app/store/showHideElement/hide-show.actions.ts:
--------------------------------------------------------------------------------
1 | import { Action } from '@ngrx/store';
2 |
3 | export enum HideShowActionTypes {
4 | invert = '[App1 HideShow] Invert show',
5 | }
6 |
7 | export class InvertHideShow implements Action {
8 | readonly type = HideShowActionTypes.invert;
9 | }
10 |
11 |
12 | export type HideShowActions = HideShowActionTypes;
13 |
--------------------------------------------------------------------------------
/projects/app1/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 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/projects/app2/src/app/store/showHideElement/hide-show.actions.ts:
--------------------------------------------------------------------------------
1 | import { Action } from '@ngrx/store';
2 |
3 | export enum HideShowActionTypes {
4 | invert = '[App2 HideShow] Invert show',
5 | }
6 |
7 | export class InvertHideShow implements Action {
8 | readonly type = HideShowActionTypes.invert;
9 | }
10 |
11 |
12 | export type HideShowActions = HideShowActionTypes;
13 |
--------------------------------------------------------------------------------
/projects/app2/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 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/projects/app1/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | App1
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/projects/app2/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | App2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/projects/admin-lib/src/lib/admin-lib.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'lib-admin-lib',
5 | template: `
6 |
7 | admin-lib works!
8 |
9 | `,
10 | styles: []
11 | })
12 | export class AdminLibComponent implements OnInit {
13 |
14 | constructor() { }
15 |
16 | ngOnInit() {
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/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/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 |
--------------------------------------------------------------------------------
/projects/admin-lib/src/lib/admin-lib.service.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed } from '@angular/core/testing';
2 |
3 | import { AdminLibService } from './admin-lib.service';
4 |
5 | describe('AdminLibService', () => {
6 | beforeEach(() => TestBed.configureTestingModule({}));
7 |
8 | it('should be created', () => {
9 | const service: AdminLibService = TestBed.get(AdminLibService);
10 | expect(service).toBeTruthy();
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/projects/app1/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/some-core-component/some-core-component.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-some-core-component',
5 | templateUrl: './some-core-component.component.html',
6 | styleUrls: ['./some-core-component.component.scss']
7 | })
8 | export class SomeCoreComponentComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/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
--------------------------------------------------------------------------------
/projects/app2/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { App2Module } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(App2Module)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/projects/app1/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
--------------------------------------------------------------------------------
/projects/app2/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
--------------------------------------------------------------------------------
/projects/app1/src/app/store/showHideElement/hide-show.reducer.ts:
--------------------------------------------------------------------------------
1 | import { Action } from '@ngrx/store';
2 | import {HideShowActionTypes} from './hide-show.actions';
3 |
4 |
5 | export interface ShowState {
6 | show: boolean;
7 | }
8 |
9 | export const initialState: ShowState = {
10 | show: true
11 | };
12 |
13 | export function showHideReducer(state = initialState, action: Action): ShowState {
14 | switch (action.type) {
15 | case HideShowActionTypes.invert:
16 | return {
17 | show: !state.show
18 | };
19 | default:
20 | return state;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/projects/app2/src/app/store/showHideElement/hide-show.reducer.ts:
--------------------------------------------------------------------------------
1 | import { Action } from '@ngrx/store';
2 | import {HideShowActionTypes} from './hide-show.actions';
3 |
4 |
5 | export interface ShowState {
6 | show: boolean;
7 | }
8 |
9 | export const initialState: ShowState = {
10 | show: true
11 | };
12 |
13 | export function showHideReducer(state = initialState, action: Action): ShowState {
14 | switch (action.type) {
15 | case HideShowActionTypes.invert:
16 | return {
17 | show: !state.show
18 | };
19 | default:
20 | return state;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Welcome to {{ title }}!
5 |
6 |
7 |
8 |
Outlets below:
9 |
10 |
App1
11 |
App2
12 |
Some Core App Route
13 |
14 |
15 |
--------------------------------------------------------------------------------
/projects/app1/src/app/store/showHideElement/hide-show.selectors.ts:
--------------------------------------------------------------------------------
1 | import {ShowState} from './hide-show.reducer';
2 | import {createFeatureSelector, createSelector, MemoizedSelector} from '@ngrx/store';
3 |
4 | const getShowValue = (state: ShowState): boolean => state.show;
5 |
6 | const selectShowState: MemoizedSelector<
7 | object,
8 | ShowState
9 | > = createFeatureSelector
('app1ShowHide');
10 |
11 | const selectShowValue: MemoizedSelector