.browserslistrc000066400000000000000000000015251516076740600141650ustar00rootroot00000000000000# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. # For additional information regarding the format and rule options, please see: # https://github.com/browserslist/browserslist#queries # For the full list of supported browsers by the Angular framework, please see: # https://angular.io/guide/browser-support # You can see what browsers were selected by your queries by running: # npx browserslist last 1 Chrome version last 1 Firefox version last 2 Edge major versions last 2 Safari major versions last 2 iOS major versions Firefox ESR not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line. not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. .editorconfig000066400000000000000000000006371516076740600135550ustar00rootroot00000000000000# EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # Change these settings to your own preference indent_style = space indent_size = 4 # We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false .eslintrc.json000066400000000000000000000020741516076740600136710ustar00rootroot00000000000000{ "root": true, "ignorePatterns": [ "projects/**/*" ], "overrides": [ { "files": [ "*.ts" ], "parserOptions": { "project": [ "tsconfig.json", "e2e/tsconfig.json" ], "createDefaultProgram": true }, "extends": [ "plugin:@angular-eslint/ng-cli-compat", "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", "plugin:@angular-eslint/template/process-inline-templates" ], "rules": { "@angular-eslint/component-selector": [ "error", { "type": "element", "prefix": "app", "style": "kebab-case" } ], "@angular-eslint/directive-selector": [ "error", { "type": "attribute", "prefix": "app", "style": "camelCase" } ] } }, { "files": [ "*.html" ], "extends": [ "plugin:@angular-eslint/template/recommended" ], "rules": {} } ] } .github/000077500000000000000000000000001516076740600124325ustar00rootroot00000000000000.github/workflows/000077500000000000000000000000001516076740600144675ustar00rootroot00000000000000.github/workflows/build.yml000066400000000000000000000016761516076740600163230ustar00rootroot00000000000000# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: build on: schedule: - cron: '0 0 1 * *' push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: ['lts/*'] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: npm i -g grunt-cli - run: npm install - run: grunt .gitignore000066400000000000000000000003261516076740600130630ustar00rootroot00000000000000/node_modules /build /dist .idea/workspace.xml .idea/tasks.xml .idea/profiles_settings.xml .idea/inspectionProfiles/Project_Default.xml .idea/inspectionProfiles/profiles_settings.xml node_modules/.yarn-integrity .idea/000077500000000000000000000000001516076740600120525ustar00rootroot00000000000000.idea/angular-compile.iml000066400000000000000000000005201516076740600156310ustar00rootroot00000000000000 .idea/codeStyleSettings.xml000066400000000000000000000004251516076740600162510ustar00rootroot00000000000000 .idea/inspectionProfiles/000077500000000000000000000000001516076740600157315ustar00rootroot00000000000000.idea/inspectionProfiles/profiles_settings.xml000066400000000000000000000002341516076740600222150ustar00rootroot00000000000000 .idea/misc.xml000066400000000000000000000002561516076740600135320ustar00rootroot00000000000000 .idea/modules.xml000066400000000000000000000004321516076740600142430ustar00rootroot00000000000000 .idea/vcs.xml000066400000000000000000000002471516076740600133720ustar00rootroot00000000000000 .ncurc.json000066400000000000000000000002711516076740600131550ustar00rootroot00000000000000{ "reject": [ "core-js", "reflect-metadata", "rxjs", "tslib", "zone.js", "typescript", "karma", "ng-packagr" ] } .npmignore000066400000000000000000000004411516076740600130700ustar00rootroot00000000000000/.idea /artifacts /build /test /node_modules /*.iml /*.ipr /*.iws /.travis.yml /.scrutinizer.yml /Gruntfile.js /*.lock *.log /corifeus-boot.json # Corifeus / P3X /tsconfig* /dist/node_modules /dist/test /src /src-save /index.ts # need to allow ts for awesome=typscript-loader /.github .travis.yml000066400000000000000000000014701516076740600132050ustar00rootroot00000000000000sudo: required language: node_js node_js: - lts/* before_script: - npm install -g grunt-cli npm - npm install env: global: secure: c1EmMJCCfB1cFe//vM+fw+PzBCYII2szjXyvzQ+GKtBfH4MmYsgupdhLyCYbN0q4ASpb5ajL9ynEQrQMax1mmjGK1BoHdx7HqB1+p3fFDdyfMr59zcbufHjoepjvm1b1bdxmHv4HhKVeyuhcNDQLEFy4FGNLFLkB31Wj/tFhQd9DRxt23ubsdpsG8xHknvqTCOxoZxQZ0PQrtTIKDtJTjVaSkcU5X8SbShs1z6zt6ciiOa+Y1fSHoFU6cjepqPbrfK2LV6+9PEHj0RZ0XbqoPnPcOus7HLUuv2v3CZLxjTGpr97Ah1QzSeEFfqZtS8rddTiUo8LdeXxCkpm6tkhdi4GCYVsTuClfoKOqhkH6Q6/LRVd2ZnvPAzpiwhfSuQCat8tBuB3LJP5Z2gysSHYjoj+mVX79WksKhsNuaJuWSdmEwfXUq/2B9KsFUNxhebW2DdIby7Kz0w1L5UtS83kacT/U/ZVtoA+D8nRxgJ78BukWPPyImZZItfnd1Kht2AVujsNN90n0+p5t8JtRwQBVhJQtwK550OZiwd9WpGuHOmLEKVSKVeCr6hCNDDWl+XDgs9JpLpUEpPY2cWl/ku8GCuM6Z/XDcK0c26LFbohK3LEo4opiLkX3M55NQYYVevIS2/mOaETcYh9qcFU/5lFojrxeiUywW5xbssc2zorNIIY= Gruntfile.js000066400000000000000000000036311516076740600133720ustar00rootroot00000000000000const utils = require('corifeus-utils'); const path = require('path') const fs = require('fs').promises module.exports = (grunt) => { const builder = require(`corifeus-builder`); const loader = new builder.loader(grunt); loader.js({ replacer: { type: 'p3x', npmio: true, }, config: { htmlmin: { dist: { options: { // Target options removeComments: true, collapseWhitespace: true, minifyCSS: true, }, files: { './dist/angular-compile-workspace/index.html': './dist/angular-compile-workspace/index.html' } } }, } }); grunt.registerTask('publish', async function () { const done = this.async(); try { await builder.utils.spawn({ grunt: grunt, gruntThis: this, }, { cmd: 'npm', args: [ 'run', 'build-lib', ] }); done() } catch (e) { done(e) } }); grunt.registerTask('build', async function () { const done = this.async(); try { await builder.utils.spawn({ grunt: grunt, gruntThis: this, }, { cmd: 'npm', args: [ 'run', 'build-app', ] }); done() } catch (e) { done(e) } }); const defaultTask = builder.config.task.build.js.concat(['cory-angular-hook-lib', 'cory-raw-npm-angular', 'build', 'htmlmin:dist']) grunt.registerTask('default', defaultTask ); } LICENSE000066400000000000000000000023571516076740600121060ustar00rootroot00000000000000 @license p3x-angular-compile v2021.10.121 🆖 Angular Dynamic Compile - Convert strings to Angular components https://corifeus.com/angular-compile Copyright (c) 2021 Patrik Laszlo / P3X / Corifeus and contributors. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md000066400000000000000000000207301516076740600123530ustar00rootroot00000000000000[//]: #@corifeus-header [![NPM](https://nodei.co/npm/p3x-angular-compile.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/p3x-angular-compile/) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://paypal.me/patrikx3) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Corifeus @ Facebook](https://img.shields.io/badge/Facebook-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Build Status](https://github.com/patrikx3/angular-compile/workflows/build/badge.svg)](https://github.com/patrikx3/angular-compile/actions?query=workflow%3Abuild) [![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m780749701-41bcade28c1ea8154eda7cca.svg)](https://stats.uptimerobot.com/9ggnzcWrw) # 🆖 Angular Dynamic Compile - Convert strings to Angular components v2021.10.123 **Bugs are evident™ - MATRIX️** ### NodeJs version requirement ```txt >=12.13.0 ``` ### Built on NodeJs ```txt v14.17.6 ``` # Built on Angular ```text 12.2.6 ``` # Description [//]: #@corifeus-header:end # WARNING Angular has changed, so it stricts many things for dynamic compilation. The only solution right now, is to simple copy the code into your code and it will work (like on https://angular-compile.corifeus.com/). The code you just copy into your project is here: https://github.com/patrikx3/angular-compile/tree/master/projects/angular-compile/src/lib # Use case Dynamically compile standard strings to fully functional Angular components. Supports imports, exports, and standard context. ## Install ```bash npm install --save p3x-angular-compile # or yarn add p3x-angular-compile ``` ## Check out how it works and code https://angular-compile.corifeus.com https://github.com/patrikx3/angular-compile/blob/master/src/app/app.component.ts ## IMPORTANT Make sure AOT is disabled in the `angular.json`: ```json { "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/workspace", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", // make sure it is false "aot": false, "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [] } } } ``` #### Minimum build requirement arguments ```bash ng build --aot=false --build-optimizer=false ``` ## Usage ```typescript import { CompileModule} from "p3x-angular-compile" // the module settings @NgModule({ imports: [ CorifeusWebMaterialModule, // Optional CompileModule, // Required ], declarations: [ Page, ], providers: [ ], bootstrap: [ Page ] }) export class Module { }; ``` #### Template ```html *ngIf="isEnabled" [p3x-compile]="template" [p3x-compile-ctx]="this" [p3x-compile-error-handler]="handleCompileErrorHandler" [p3x-compile-module]="dataModule" > ``` #### Code ```typescript // A page example export class Page { isEnabled: boolean = true; dataModule : any = { //schemas: [CUSTOM_ELEMENTS_SCHEMA], //declarations: [], imports: [ MatButtonModule ], exports: [ ] } template: string = ""; handleCompileErrorHandler(error: Error) { console.error(error) } alert() { alert('ok'); } } ``` ### Options [Reference for the Angular module settings which are available.]( https://github.com/angular/angular/blob/master/packages/core/src/metadata/ng_module.ts) ## Dev environment end test ```bash npm install -g yarn git clone https://github.com/patrikx3/angular-compile.git cd angular-compile npm install npm run start ``` [http://localhost:4200](http://localhost:4200) # Errors ## Type x is part of the declarations of 2 modules Basically, you need a shared component. https://stackoverflow.com/questions/42993580/angular-2-type-childcomponent-is-a-part-of-the-declarations-of-2-modules-par ## AOT + JIT ### Since Angular 5.x.x + We cannot use AOT + JIT at once. #### Info https://github.com/angular/angular/issues/20156#issuecomment-341767899 On the issue, you can see: ```text To reduce the payload, we do not ship the compiler in AOT. ``` So right now, it is not possible. Although, there are some hacks, but you are on your own... https://github.com/angular/angular/issues/20156#issuecomment-468686933 ### Size If you want very small bundle, use ```gzip```. [//]: #@corifeus-footer --- 🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much! Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up. All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable. **Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme. --- [**P3X-ANGULAR-COMPILE**](https://corifeus.com/angular-compile) Build v2021.10.123 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) ## P3X Sponsor [IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com/?from=patrikx3) [![JetBrains](https://cdn.corifeus.com/assets/svg/jetbrains-logo.svg)](https://www.jetbrains.com/?from=patrikx3) [//]: #@corifeus-footer:end angular-compile.iml000066400000000000000000000005171516076740600146570ustar00rootroot00000000000000 angular.json000066400000000000000000000117371516076740600134270ustar00rootroot00000000000000{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "angular-compile-workspace": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/angular-compile-workspace", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "aot": false, "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [], "vendorChunk": true, "extractLicenses": false, "buildOptimizer": false, "sourceMap": true, "optimization": false, "namedChunks": true }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" }, { "type": "anyComponentStyle", "maximumWarning": "6kb", "maximumError": "10kb" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "angular-compile-workspace:build" }, "configurations": { "production": { "browserTarget": "angular-compile-workspace:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "angular-compile-workspace:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [] } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": [ "src/**/*.ts", "src/**/*.html" ] } }, "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", "devServerTarget": "angular-compile-workspace:serve" }, "configurations": { "production": { "devServerTarget": "angular-compile-workspace:serve:production" } } } } }, "angular-compile": { "projectType": "library", "root": "projects/angular-compile", "sourceRoot": "projects/angular-compile/src", "prefix": "lib", "architect": { "build": { "builder": "@angular-devkit/build-angular:ng-packagr", "options": { "tsConfig": "projects/angular-compile/tsconfig.lib.json", "project": "projects/angular-compile/ng-package.json" }, "configurations": { "production": { "tsConfig": "projects/angular-compile/tsconfig.lib.prod.json" } } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "projects/angular-compile/src/test.ts", "tsConfig": "projects/angular-compile/tsconfig.spec.json", "karmaConfig": "projects/angular-compile/karma.conf.js" } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": [ "projects/angular-compile/**/*.ts", "projects/angular-compile/**/*.html" ] } } } } }, "defaultProject": "angular-compile-workspace" } e2e/000077500000000000000000000000001516076740600115455ustar00rootroot00000000000000e2e/protractor.conf.js000066400000000000000000000015451516076740600152330ustar00rootroot00000000000000// @ts-check // Protractor configuration file, see link for more information // https://github.com/angular/protractor/blob/master/lib/config.ts const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); /** * @type { import("protractor").Config } */ exports.config = { allScriptsTimeout: 11000, specs: [ './src/**/*.e2e-spec.ts' ], capabilities: { browserName: 'chrome' }, directConnect: true, baseUrl: 'http://localhost:4200/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, print: function() {} }, onPrepare() { require('ts-node').register({ project: require('path').join(__dirname, './tsconfig.json') }); jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: StacktraceOption.PRETTY } })); } };e2e/src/000077500000000000000000000000001516076740600123345ustar00rootroot00000000000000e2e/src/app.e2e-spec.ts000066400000000000000000000012121516076740600150620ustar00rootroot00000000000000import { AppPage } from './app.po'; import { browser, logging } from 'protractor'; describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); // expect(page.getTitleText()).toEqual('angular-compile app is running!'); }); afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); expect(logs).not.toContain(jasmine.objectContaining({ level: logging.Level.SEVERE, } as logging.Entry)); }); }); e2e/src/app.po.ts000066400000000000000000000004551516076740600141050ustar00rootroot00000000000000import { browser, by, element } from 'protractor'; export class AppPage { navigateTo(): Promise { return browser.get(browser.baseUrl) as Promise; } getTitleText(): Promise { return element(by.css('app-root .content span')).getText() as Promise; } } e2e/tsconfig.json000066400000000000000000000004461516076740600142600ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", "target": "es2018", "types": [ "jasmine", "jasminewd2", "node" ] } } karma.conf.js000066400000000000000000000020031516076740600134420ustar00rootroot00000000000000// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, './coverage/angular-compile'), reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false, restartOnFileChange: true }); }; package.json000066400000000000000000000072331516076740600133650ustar00rootroot00000000000000{ "name": "p3x-angular-compile", "version": "2021.10.123", "corifeus": { "prefix": "p3x-", "publish": true, "type": "p3x", "code": "Logico", "nodejs": "v14.17.6", "opencollective": false, "reponame": "angular-compile", "build": true, "cdn": true, "angular": "12.2.6", "publish-location": "./dist/angular-compile" }, "description": "🆖 Angular Dynamic Compile - Convert strings to Angular components", "scripts": { "ng": "ng", "start": "ng serve --hmr", "build": "ng build", "test": "grunt", "lint": "ng lint", "e2e": "ng e2e", "build-lib": "ng build --configuration=production --project angular-compile && cp README.md ./dist/angular-compile && cp LICENSE ./dist/angular-compile && node node_modules/corifeus-builder/src/utils/angular/post-lib-build.js", "build-app-info": "Have to disable AOT for this build", "build-app": "ng build --configuration=production --source-map=false --output-hashing=all --deploy-url=/ --base-href=/ --aot=false --build-optimizer=false --optimization=true && grunt htmlmin:dist", "stats": "ng build --stats-json && webpack-bundle-analyzer dist/angular-compile-workspace/stats.json" }, "repository": { "type": "git", "url": "git+https://github.com/patrikx3/angular-compile.git" }, "keywords": [ "p3x", "angular", "ng", "compile", "html", "angular", "dynamic", "aot" ], "author": "Patrik Laszlo ", "license": "MIT", "bugs": { "url": "https://github.com/patrikx3/angular-compile/issues" }, "homepage": "https://corifeus.com/angular-compile", "dependencies": { "@angular/animations": "~12.2.6", "@angular/cdk": "^12.2.6", "@angular/common": "~12.2.6", "@angular/compiler": "~12.2.6", "@angular/core": "~12.2.6", "@angular/forms": "~12.2.6", "@angular/material": "^12.2.6", "@angular/platform-browser": "~12.2.6", "@angular/platform-browser-dynamic": "~12.2.6", "@angular/router": "~12.2.6", "postcss": "^8.3.6", "rxjs": "~6.6.3", "tslib": "^2.2.0", "zone.js": "~0.11.4" }, "devDependencies": { "@angular-devkit/build-angular": "~12.2.6", "@angular-eslint/builder": "^12.5.0", "@angular-eslint/eslint-plugin": "^12.5.0", "@angular-eslint/eslint-plugin-template": "^12.5.0", "@angular-eslint/schematics": "^12.5.0", "@angular-eslint/template-parser": "^12.5.0", "@angular/cli": "~12.2.6", "@angular/compiler-cli": "~12.2.6", "@types/jasmine": "~3.9.1", "@types/jasminewd2": "~2.0.10", "@types/node": "^16.9.4", "@typescript-eslint/eslint-plugin": "4.31.1", "@typescript-eslint/parser": "4.31.1", "codelyzer": "^6.0.2", "corifeus-builder": "^2021.10.131", "eslint": "^7.32.0", "eslint-plugin-import": "2.24.2", "eslint-plugin-jsdoc": "36.1.0", "eslint-plugin-prefer-arrow": "1.2.3", "jasmine-core": "~3.9.0", "jasmine-spec-reporter": "~7.0.0", "karma": "~6.3.2", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.3", "karma-jasmine": "~4.0.1", "karma-jasmine-html-reporter": "^1.7.0", "ng-packagr": "^12.0.0", "protractor": "~7.0.0", "ts-node": "~10.2.1", "typescript": "~4.2.4", "webpack-bundle-analyzer": "^4.4.2" }, "engines": { "node": ">=12.13.0" } } projects/000077500000000000000000000000001516076740600127235ustar00rootroot00000000000000projects/angular-compile/000077500000000000000000000000001516076740600160025ustar00rootroot00000000000000projects/angular-compile/.eslintrc.json000066400000000000000000000015341516076740600206010ustar00rootroot00000000000000{ "extends": "../../.eslintrc.json", "ignorePatterns": [ "!**/*" ], "overrides": [ { "files": [ "*.ts" ], "parserOptions": { "project": [ "projects/angular-compile/tsconfig.lib.json", "projects/angular-compile/tsconfig.spec.json" ], "createDefaultProgram": true }, "rules": { "@angular-eslint/component-selector": [ "error", { "type": "element", "prefix": "lib", "style": "kebab-case" } ], "@angular-eslint/directive-selector": [ "error", { "type": "attribute", "prefix": "lib", "style": "camelCase" } ] } }, { "files": [ "*.html" ], "rules": {} } ] } projects/angular-compile/.gitkeep000066400000000000000000000000151516076740600174270ustar00rootroot00000000000000node_modules projects/angular-compile/README.md000066400000000000000000000020431516076740600172600ustar00rootroot00000000000000# AngularCompile This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.5. ## Code scaffolding Run `ng generate component component-name --project angular-compile` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project angular-compile`. > Note: Don't forget to add `--project angular-compile` or else it will be added to the default project in your `angular.json` file. ## Build Run `ng build angular-compile` to build the project. The build artifacts will be stored in the `dist/` directory. ## Publishing After building your library with `ng build angular-compile`, go to the dist folder `cd dist/angular-compile` and run `npm publish`. ## Running unit tests Run `ng test angular-compile` to execute the unit tests via [Karma](https://karma-runner.github.io). ## Further help 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). projects/angular-compile/karma.conf.js000066400000000000000000000020071516076740600203560ustar00rootroot00000000000000// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../../coverage/angular-compile'), reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false, restartOnFileChange: true }); }; projects/angular-compile/ng-package.json000066400000000000000000000002441516076740600206720ustar00rootroot00000000000000{ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", "dest": "../../dist/angular-compile", "lib": { "entryFile": "src/public-api.ts" } }projects/angular-compile/package.json000066400000000000000000000006361516076740600202750ustar00rootroot00000000000000{ "name": "p3x-angular-compile", "version": "0.0.1", "peerDependencies": { "@angular/common": "^12.0.0", "@angular/core": "^12.0.0", "lodash": "^4.17.21", "@types/lodash": "^4.14.169" }, "corifeus": { "install": false }, "devDependencies": { "corifeus-builder": "^2021.4.132" }, "dependencies": { "tslib": "^2.0.0" } }projects/angular-compile/src/000077500000000000000000000000001516076740600165715ustar00rootroot00000000000000projects/angular-compile/src/lib/000077500000000000000000000000001516076740600173375ustar00rootroot00000000000000projects/angular-compile/src/lib/angular-compile.component.ts000066400000000000000000000130701516076740600247700ustar00rootroot00000000000000import { Compiler, Component, Injectable, Input, ModuleWithProviders, NgModule, NgModuleFactory, OnChanges, SimpleChanges, Type, } from '@angular/core'; import {CommonModule} from '@angular/common'; //import { BrowserModule } from '@angular/platform-browser'; //let SingletonDefaultModule: NgModule; //import cloneDeep from 'lodash/cloneDeep'; //import { CorifeusMaterialModule } from 'corifeus-web-material'; function reverse(str: string) { return str.split('').reverse().join('') } function random() { return (Math.floor(Math.random() * (99999999999999999 - 10000000000000000)) + 10000000000000000).toString(16) } let currentIdTime: number; let currentId = 0; function nextId(): string { const now = Date.now(); if (currentIdTime !== now) { currentId = 0; currentIdTime = now } const comingId = ++currentId; const randomHex = reverse(random()).padStart(15, '0'); const timeHex = reverse(currentIdTime.toString(16).padStart(12, '0')) const comingIdHex = reverse(comingId.toString(16).padStart(3, '0')) const newId: string = `p3x-angular-compile-${timeHex}${comingIdHex}${randomHex}`; //console.log(newId) return newId } //const cache : any = {}; @Component({ selector: '[p3x-compile]', template: ` ` }) @Injectable() export class CompileAttribute implements OnChanges { //export class CompileAttribute implements OnChanges ,OnInit { @Input('p3x-compile') html: string; @Input('p3x-compile-ctx') context: any; @Input('p3x-compile-error-handler') errorHandler: Function = undefined; dynamicComponent: any; dynamicModule: NgModuleFactory | any; @Input('p3x-compile-module') module: NgModule; @Input('p3x-compile-imports') imports: Array | ModuleWithProviders | any[]>; constructor( // private container: ViewContainerRef, // private service: CompileService private compiler: Compiler, // @Inject('config') private config:CompileServiceConfig ) { } /* // not requires, since ngOnChanges does it first time change ngOnInit() { //console.log('ng init') // this.update(); } */ get renderComponent() { return typeof this.html === 'string' && this.html.trim() !== '' } ngOnChanges(changes: SimpleChanges) { //console.log('ng one changes') this.update(); } update() { try { if (this.html === undefined || this.html === null || this.html.trim() === '') { // this.container.clear(); this.dynamicComponent = undefined; this.dynamicModule = undefined; return; } /* // looks like Angular already is caching //console.log('html', this.html) const cacheKey = this.html; //console.log(Object.keys(cache).indexOf(cacheKey), cache) if (cache.hasOwnProperty(cacheKey)) { const currentCache = cache[cacheKey]; this.dynamicComponent = currentCache.dynamicComponent this.dynamicModule = currentCache.dynamicModule return ; } */ this.dynamicComponent = this.createNewComponent(this.html, this.context); this.dynamicModule = this.compiler.compileModuleSync(this.createComponentModule(this.dynamicComponent)); /* cache[cacheKey] = { dynamicComponent: this.dynamicComponent, dynamicModule: this.dynamicModule, }; */ } catch (e) { if (this.errorHandler === undefined) { throw e; } else { this.errorHandler(e); } } /* // now we use it with ngComponentOutlet, since about angular 5 await this.service.compile({ template: this.html, container: this.container, context: this.context, imports: this.imports, module: this.module }) */ } private createComponentModule(componentType: any) { let module: NgModule = {}; if (this.module !== undefined) { module = Object.assign({}, this.module); } /* else if (SingletonDefaultModule !== undefined && SingletonDefaultModule !== null) { module = cloneDeep(SingletonDefaultModule); } */ module.imports = module.imports || []; module.imports.push(CommonModule); if (this.imports !== undefined) { module.imports = module.imports.concat(this.imports) } if (module.declarations === undefined) { module.declarations = [ componentType ]; } else { module.declarations.push(componentType); } module.entryComponents = [ componentType ]; @NgModule(module) class RuntimeComponentModule { } return RuntimeComponentModule; } private createNewComponent(html: string, context: any) { const selector: string = nextId() @Component({ selector: selector, template: html }) class DynamicComponent { context: any = context; } return DynamicComponent; } } projects/angular-compile/src/lib/angular-compile.module.ts000066400000000000000000000005401516076740600242510ustar00rootroot00000000000000import { NgModule, //ModuleWithProviders, } from '@angular/core'; import {CompileAttribute} from "./angular-compile.component"; import {CommonModule} from '@angular/common'; @NgModule({ declarations: [ CompileAttribute ], imports: [ CommonModule ], exports: [ CompileAttribute ] }) export class CompileModule { } projects/angular-compile/src/public-api.ts000066400000000000000000000002201516076740600211600ustar00rootroot00000000000000/* * Public API Surface of angular-compile */ export * from './lib/angular-compile.module'; export * from './lib/angular-compile.component'; projects/angular-compile/src/test.ts000066400000000000000000000013711516076740600201220ustar00rootroot00000000000000// This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js'; import 'zone.js/testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; declare const require: { context(path: string, deep?: boolean, filter?: RegExp): { keys(): string[]; (id: string): T; }; }; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting() ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); projects/angular-compile/tsconfig.lib.json000066400000000000000000000010341516076740600212540ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/lib", "target": "es2015", "declaration": true, "declarationMap": true, "inlineSources": true, "types": [], "lib": [ "dom", "es2018" ] }, "angularCompilerOptions": { "skipTemplateCodegen": true, "strictMetadataEmit": true, "enableResourceInlining": true }, "exclude": [ "src/test.ts", "**/*.spec.ts" ] } projects/angular-compile/tsconfig.lib.prod.json000066400000000000000000000003461516076740600222240ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.lib.json", "compilerOptions": { "declarationMap": false }, "angularCompilerOptions": { "enableIvy": false } } projects/angular-compile/tsconfig.spec.json000066400000000000000000000004651516076740600214470ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/spec", "types": [ "jasmine" ] }, "files": [ "src/test.ts" ], "include": [ "**/*.spec.ts", "**/*.d.ts" ] } src/000077500000000000000000000000001516076740600116615ustar00rootroot00000000000000src/app/000077500000000000000000000000001516076740600124415ustar00rootroot00000000000000src/app/app.component.html000066400000000000000000000051311516076740600161100ustar00rootroot00000000000000
P3X Angular Compile v{{ version }} Corifeus.com Wiki

How it works from the code in GitHub, some examples

Go ahead and inspect the elements and click away!!!


Template 1


Template 2


Template 3


Template 4 - Re-use the same context



Pure Router Link with JIT Angular
 


Router Link with p3x-angular-compile
src/app/app.component.scss000066400000000000000000000002011516076740600161100ustar00rootroot00000000000000.p3x-angular-compile-element { border: 1px dashed grey; background-color: rgba(128, 128, 128, 0.1); padding: 8px; } src/app/app.component.ts000066400000000000000000000076621516076740600156050ustar00rootroot00000000000000import {Component} from '@angular/core'; import packageInfo from '../../package.json'; import { MatButtonModule } from "@angular/material/button"; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { version = packageInfo.version data1: string; data2: string = 'init'; data3: string = 'Just simple stringinfo'; counter1: number = 0; counter2: number = 0; interval: any; dataRouterLink: string = '' compileForm: string = `` dataMaterialDefault: string = ` ` dataMaterial: string = ` ` dataMaterialModule: any = { // schemas: [CUSTOM_ELEMENTS_SCHEMA], // declarations: [], imports: [ MatButtonModule ], exports: [] } constructor( // private compileHtmlService: CompileService ) { } private update1() { this.counter1++; this.data1 = `
P3X Angular Compile
{{ context.counter1}}
`; } public formClick() { alert('form click'); } private update2() { this.counter2++; this.data2 = `
Attribute
{{ context.counter2}}
`; } chars: string = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' getRandomChar() { return this.chars[Math.floor(Math.random() * (62 - 0)) + 0] } randomRouterLinkPure() { let counter = 0; let randomString = ''; while (counter < 10) { counter++; randomString += this.getRandomChar(); } this.dataRouterLink = `${randomString}` } randomRouterLinkJit() { let counter = 0; let randomString2 = ''; while (counter < 10) { counter++; randomString2 += this.getRandomChar(); } this.dataMaterial = ` ${this.dataMaterialDefault}   ${randomString2} ` } ngOnInit() { this.update1(); this.update2(); this.randomRouterLinkPure() this.randomRouterLinkJit() /* let is = false; let newData = '123'; let defaultData = ''; let count = 0; this.interval = setInterval(() => { is = !is; if (is) { count++; defaultData = defaultData + newData; this.data3 = defaultData + defaultData; if (count > 10) { count = 0; defaultData = newData; } } else { this.data3 = '
321
' } }, 1000) */ } ngOnDestroy() { clearInterval(this.interval); } } src/app/app.module.ts000066400000000000000000000016771516076740600150700ustar00rootroot00000000000000import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angular/core'; import {AppComponent} from './app.component'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {CompileModule} from "../../projects/angular-compile/src/lib/angular-compile.module"; import {MatToolbarModule} from "@angular/material/toolbar"; import {MatCardModule} from "@angular/material/card"; import {MatButtonModule} from "@angular/material/button"; import { MatDividerModule} from "@angular/material/divider"; @NgModule({ declarations: [ AppComponent ], imports: [ MatDividerModule, BrowserAnimationsModule, //MatProgressSpinnerModule, MatCardModule, MatButtonModule, MatToolbarModule, CompileModule, BrowserModule, BrowserAnimationsModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } src/assets/000077500000000000000000000000001516076740600131635ustar00rootroot00000000000000src/assets/.gitkeep000066400000000000000000000000001516076740600146020ustar00rootroot00000000000000src/environments/000077500000000000000000000000001516076740600144105ustar00rootroot00000000000000src/environments/environment.prod.ts000066400000000000000000000000651516076740600202700ustar00rootroot00000000000000export const environment = { production: true }; src/environments/environment.ts000066400000000000000000000012331516076740600173230ustar00rootroot00000000000000// This file can be replaced during build by using the `fileReplacements` array. // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. export const environment = { production: false }; /* * For easier debugging in development mode, you can import the following file * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. * * This import should be commented out in production mode because it will have a negative impact * on performance if an error is thrown. */ // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. src/favicon.ico000066400000000000000000000764461516076740600140230ustar00r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]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI ]KII]KI]KI]KI]KI]KI]KI]KI]KI]KI]KHC]KI)]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI]KIg]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI-]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI#]KI]KI]KI]KI]KI]KI]KI]KHu]KIk]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JIm]KIc]KI]KI]KI]KI]KI]KI]KI!]KI \KIk]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI%]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KIo\KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI]KI]KI/]JI]KI]KI\JH]KHa]KH ]KIk]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI5]KI]KI]KI]KI]KI]KI\JH]KIo]KI]KI]KI]KI]KI]KI]KI]KH]JH%]KI]KI]KI\JH]KIk\KI]KI]KI]KI]KI]KI]KI;]KI]KI]KI ]KH ]KIo]KI]KI]KI]KI]KI\KH]KI\KIk]KI]KI]KI]KIG]KI ]KIc\KI]KI\JI src/index.html000066400000000000000000000011131516076740600136520ustar00rootroot00000000000000 P3X Angular Compile src/main.ts000066400000000000000000000007471516076740600131650ustar00rootroot00000000000000import {enableProdMode} from '@angular/core'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {AppModule} from './app/app.module'; import {environment} from './environments/environment'; window['corifeus'] = { core: { http: { status: 200, counter: 0, } } } if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); src/polyfills.ts000066400000000000000000000054101516076740600142460ustar00rootroot00000000000000/** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. * * This file is divided into 2 sections: * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. * 2. Application imports. Files imported after ZoneJS that should be loaded before your main * file. * * The current setup is for so-called "evergreen" browsers; the last versions of browsers that * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. * * Learn more in https://angular.io/guide/browser-support */ /*************************************************************************************************** * BROWSER POLYFILLS */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** * Web Animations `@angular/platform-browser/animations` * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). */ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. /** * By default, zone.js will patch all possible macroTask and DomEvents * user can disable parts of macroTask/DomEvents patch by setting following flags * because those flags need to be set before `zone.js` being loaded, and webpack * will put import in the top of bundle, so user need to create a separate file * in this directory (for example: zone-flags.ts), and put the following flags * into that file, and then add the following code before importing zone.js. * import './zone-flags'; * * The flags allowed in zone-flags.ts are listed here. * * The following flags will work for all browsers. * * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames * * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js * with the following flag, it will bypass `zone.js` patch for IE/Edge * * (window as any).__Zone_enable_cross_context_check = true; * */ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ import 'zone.js'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ src/styles.scss000066400000000000000000000027041516076740600141040ustar00rootroot00000000000000@use '~@angular/material' as mat; /* You can add global styles to this file, and also import other style files */ html, body { height: 100%; } body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } @include mat.core(); $workspace-primary: mat.define-palette(mat.$green-palette); $workspace-accent: mat.define-palette(mat.$purple-palette, A200, A100, A400); $workspace-warn: mat.define-palette(mat.$red-palette); $workspace-theme: mat.define-light-theme($workspace-primary, $workspace-accent, $workspace-warn); @include mat.core-theme($workspace-theme); @include mat.divider-theme($workspace-theme); @include mat.card-theme($workspace-theme); @include mat.toolbar-theme(mat.define-light-theme( mat.define-palette(mat.$blue-grey-palette, 700), mat.define-palette(mat.$blue-grey-palette, 200), mat.define-palette(mat.$green-palette) )); @include mat.button-theme(mat.define-light-theme( mat.define-palette(mat.$orange-palette, 900), mat.define-palette(mat.$indigo-palette, 500), mat.define-palette(mat.$red-palette, 500) )); .p3x-ng-compile-template-intent:before { } .p3x-ng-compile-template-intent { color: mat.get-color-from-palette(mat.$grey-palette, 500); padding: 8px; font-size: 18px; font-weight: bold; display: inline-block; } .p3x-ng-compile-template { font-size: 18px; font-weight: bold; display: inline-block; } a.mat-button { //padding: 0; } src/test.ts000066400000000000000000000013571516076740600132160ustar00rootroot00000000000000// This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js/testing'; import {getTestBed} from '@angular/core/testing'; import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing'; declare const require: { context(path: string, deep?: boolean, filter?: RegExp): { keys(): string[]; (id: string): T; }; }; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting() ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); tsconfig.app.json000066400000000000000000000004371516076740600143640ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] }, "files": [ "src/main.ts", "src/polyfills.ts" ], "include": [ "src/**/*.d.ts" ] } tsconfig.json000066400000000000000000000013441516076740600136030ustar00rootroot00000000000000{ "compileOnSave": false, "compilerOptions": { "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "es2015", "module": "es2020", "lib": [ "es2018", "dom" ], "paths": { "angular-compile": [ "dist/angular-compile/angular-compile", "dist/angular-compile" ] } }, "angularCompilerOptions": { } } tsconfig.spec.json000066400000000000000000000005151516076740600145330ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ "jasmine" ] }, "files": [ "src/test.ts", "src/polyfills.ts" ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" ] }