├── .gitignore ├── LICENSE ├── README.md ├── api └── example.js ├── bin └── www ├── config ├── empty.js ├── helpers.js ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js ├── dist ├── 0.45b172136a7c1bd0d55f.chunk.js ├── 1.9b630c58fb2b72f65559.chunk.js ├── 2.c0d3a5740ddf41d4dd6b.chunk.js ├── assets │ ├── css │ │ ├── spin.css │ │ └── styles.css │ └── images │ │ └── angular.png ├── index.html ├── main.51d864a409cdc2b0a013.bundle.js ├── main.51d864a409cdc2b0a013.bundle.map ├── main.7d165cf2662242073743.bundle.js ├── main.7d165cf2662242073743.bundle.map ├── main.bundle.css ├── main.e586795ebeaf73d6214d.bundle.js ├── main.e586795ebeaf73d6214d.bundle.map ├── polyfills.82de470f112be9e1e549.bundle.js ├── polyfills.c2c08ffb041fc010b84c.bundle.js ├── vendor.9c1dabb38951a890a6c6.bundle.js ├── vendor.b649f8f3364af3abd143.bundle.js └── webpack-assets.json ├── favicon.ico ├── package.json ├── postcss.config.js ├── process.yml ├── routes └── router.js ├── server.js ├── src ├── app │ ├── app.component.css │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routing.ts │ ├── core │ │ └── core.module.ts │ ├── pages │ │ ├── +404 │ │ │ ├── 404.module.ts │ │ │ ├── 404.page.css │ │ │ ├── 404.page.html │ │ │ ├── 404.page.ts │ │ │ └── 404.routing.ts │ │ ├── +example │ │ │ ├── example.module.ts │ │ │ ├── example.page.ts │ │ │ └── example.routing.ts │ │ ├── +login │ │ │ ├── login.module.ts │ │ │ ├── login.page.css │ │ │ ├── login.page.html │ │ │ ├── login.page.ts │ │ │ └── login.routing.ts │ │ └── home │ │ │ ├── home.module.ts │ │ │ ├── home.page.css │ │ │ ├── home.page.html │ │ │ ├── home.page.ts │ │ │ └── home.routing.ts │ └── shared │ │ └── shared.module.ts ├── assets │ ├── css │ │ ├── spin.css │ │ └── styles.css │ └── images │ │ └── angular.png ├── index.html ├── main.ts ├── polyfills.ts └── vendor.ts ├── tsconfig.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.DS_Store 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | 9 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 10 | .grunt 11 | 12 | # Compiled binary addons (http://nodejs.org/api/addons.html) 13 | build/Release 14 | 15 | # Dependency directories 16 | node_modules 17 | 18 | # Optional npm cache directory 19 | .npm 20 | 21 | # upload file folder 22 | /public/attached/* 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 musicq 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular2-webpack-express-starter 2 | 3 | 这个项目是一个使用 `webpack2` 打包的,前端基于 `angular2`,后端使用 `express` 的快速启动脚手架项目。 4 | 参考 [@AngularClass 的 angular2-webpack-starter](https://angularclass.github.io/angular2-webpack-starter/) 5 | 6 | ## 安装 7 | 8 | ``` 9 | # 下载项目 10 | git clone https://github.com/musicq/angular2-webpack-express-starter.git 11 | 12 | # 安装 13 | npm install 14 | 15 | # 启动 16 | npm start 17 | ``` 18 | 19 | # 内容 20 | ## 目录结构 21 | 22 | 我在组织目录结构中可能和一些其他的项目目录结构有一点区别,我这里有一个 `pages` 文件夹,这个文件夹用来存放网站的页面的。因为很多,包括[官方的目录结构](https://angular.cn/docs/ts/latest/guide/style-guide.html#!#04-06)中都没有关于每个页面的描述(可能是我没理解透彻组件化思想)。但是我觉得,一个单页应用是由许多页面组成的,每一个页面都是由多个组件构成的,所以组件其实是为页面服务的,他应该可定制,够灵活。所以我觉得应该有一个 `pages` 文件夹来存放应用的页面。 23 | 24 | ``` 25 | angular2-webpack-express-starter/ 26 | |-api/ 27 | |-example.js * api 接口 28 | |-bin/ 29 | |-www * node 服务启动文件 30 | |-config/ * 配置文件存放位置 31 | |-empty.js 32 | |-helpers.js * 配置文件的一些辅助方法 33 | |-webpack.common.js * webpack 打包的通用配置 34 | |-webpack.dev.js * webpack 开发环境配置 35 | |-webpack.prod.js * webpack 生产环境配置 36 | |-dist/ * 生产环境打包代码 37 | |-... 38 | |-routes/ * 路由文件夹 39 | |-router.js * 路由入口文件 40 | |-src/ * 源文件存放位置,将这里的文件压缩合并输出到 dist 文件夹 41 | |-app/ * 网站内容存放文件夹 42 | |-core/ * 核心模块存放文件夹 43 | |-core.module.ts * 核心模块 44 | |-components/ * 组件文件夹 45 | |-pages/ * 存放页面文件夹 46 | |-home/ * 首页存放文件夹 47 | |-home.page.ts * 首页组件 48 | |-home.page.html * 首页模板 49 | |-home.page.css * 首页样式 50 | |-home.routing.ts * 首页路由文件 51 | |-home.module.ts * 首页模块 52 | |-+login/ * 登录模块 53 | |-+404/ * 404模块 54 | |-+example/ * 示例模块 55 | |-shared/ * 共享模块 56 | |-shared.module.ts *存放公用内容模块 57 | |-assets/ * 静态资源文件 58 | |-css/ * 站点公共样式 59 | |-images/ * 站点公用资源 60 | |-index.html * 网站首页 61 | |-polyfills.ts * polyfill 文件 62 | |-vendor.ts * 第三方内容文件 63 | |-main.ts * angular2 入口 64 | |-package.json * package.json 文件 65 | |-tsconfig.json * typescript 配置 66 | |-tslint.json * typescript lint 配置 67 | |-server.js * node 服务器文件 68 | |-postcss.config.js * postcss 插件 69 | |-process.yml * pm2 启动配置 70 | 71 | ``` 72 | 73 | ## 命令 74 | 75 | - **`npm start`** :启动应用。他实际是同时运行了 `npm run server` 和`npm run server`这两个命令。 76 | - **`npm run start:hmr`** :启动 webpack 打包 angular2 源码并启动 `3000` 端口。 77 | - **`npm run server`** :启动 node 服务,端口 `4000`。 78 | - **`npm run build:prod`** :打包应用用于生产环境。 79 | - **`npm run lint`** :检查代码书写是否规范。 80 | - **`npm run server:prod`** :正式环境启动应用。 81 | 82 | 83 | 84 | ### 说明 85 | 86 | 我没有写测试的东西,测试在工程化应用中占有很重要的地位,详细的 angular2 测试可以查看[官方的文档](https://angular.cn/docs/ts/latest/guide/testing.html)。 -------------------------------------------------------------------------------- /api/example.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | * @description 测试路由文件,路由示例 4 | */ 5 | 6 | const router = require('express').Router(); 7 | 8 | /** 9 | * @method GET 10 | * @name example-api 11 | * @description 示例 api,其他 api 请参考此 api 写法 12 | */ 13 | router.get('/example-api', function(req, res) { 14 | res.status(200).send('hello world'); 15 | }); 16 | 17 | /** 18 | * @method POST 19 | * @name example-api 20 | * @description 示例 api,其他 api 请参考此 api 写法 21 | */ 22 | router.post('/example-api', function(req, res) { 23 | let body = req.body; 24 | let params1 = body.params1, 25 | params2 = body.params2; 26 | 27 | res.status(200).send({ 28 | params1: params1, 29 | params2: params2 30 | }); 31 | }); 32 | 33 | module.exports = router; 34 | -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | const app = require('../server'); 7 | const debug = require('debug')('angular2-webpack-express-starter:server'); 8 | const http = require('http'); 9 | 10 | /** 11 | * Get port from environment and store in Express. 12 | */ 13 | const port = normalizePort(process.env.PORT || '4000'); 14 | app.set('port', port); 15 | 16 | /** 17 | * Create HTTP server. 18 | */ 19 | const server = http.createServer(app); 20 | 21 | /** 22 | * Listen on provided port, on all network interfaces. 23 | */ 24 | server.listen(port); 25 | server.on('error', onError); 26 | server.on('listening', onListening); 27 | 28 | /** 29 | * Normalize a port into a number, string, or false. 30 | */ 31 | function normalizePort(val) { 32 | let port = parseInt(val, 10); 33 | 34 | if (isNaN(port)) { 35 | // named pipe 36 | return val; 37 | } 38 | 39 | if (port >= 0) { 40 | // port number 41 | return port; 42 | } 43 | 44 | return false; 45 | } 46 | 47 | /** 48 | * Event listener for HTTP server "error" event. 49 | */ 50 | function onError(error) { 51 | if (error.syscall !== 'listen') { 52 | throw error; 53 | } 54 | 55 | let bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; 56 | 57 | // handle specific listen errors with friendly messages 58 | switch (error.code) { 59 | case 'EACCES': 60 | console.error(bind + ' requires elevated privileges'); 61 | process.exit(1); 62 | break; 63 | case 'EADDRINUSE': 64 | console.error(bind + ' is already in use'); 65 | process.exit(1); 66 | break; 67 | default: 68 | throw error; 69 | } 70 | } 71 | 72 | /** 73 | * Event listener for HTTP server "listening" event. 74 | */ 75 | function onListening() { 76 | let addr = server.address(); 77 | let bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; 78 | debug('Listening on ' + bind); 79 | } 80 | -------------------------------------------------------------------------------- /config/empty.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NgProbeToken: {}, 3 | HmrState: function() {}, 4 | _createConditionalRootRenderer: function(rootRenderer, extraTokens, coreTokens) { 5 | return rootRenderer; 6 | }, 7 | __platform_browser_private__: {} 8 | }; 9 | -------------------------------------------------------------------------------- /config/helpers.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | */ 4 | 5 | const path = require('path'); 6 | 7 | const ROOT = path.resolve(__dirname, '..'); 8 | 9 | function hasProcessFlag(flag) { 10 | return process.argv.join('').indexOf(flag) > -1; 11 | } 12 | 13 | function isWebpackDevServer() { 14 | return process.argv[1] && !! (/webpack-dev-server/.exec(process.argv[1])); 15 | } 16 | 17 | function root(args) { 18 | args = Array.prototype.slice.call(arguments, 0); 19 | return path.join.apply(path, [ROOT].concat(args)); 20 | } 21 | 22 | exports.hasProcessFlag = hasProcessFlag; 23 | exports.isWebpackDevServer = isWebpackDevServer; 24 | exports.root = root; -------------------------------------------------------------------------------- /config/webpack.common.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | */ 4 | 5 | const webpack = require('webpack'); 6 | const helpers = require('./helpers'); 7 | 8 | /** 9 | * Webpack Plugins 10 | */ 11 | const AssetsPlugin = require('assets-webpack-plugin'); 12 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 13 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 14 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 15 | const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); 16 | const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin'); 17 | const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin'); 18 | const ForkCheckerPlugin = require('awesome-typescript-loader').ForkCheckerPlugin; 19 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin'); 20 | 21 | /** 22 | * Webpack Constants 23 | */ 24 | const HMR = helpers.hasProcessFlag('hot'); 25 | const METADATA = { 26 | title: 'Angular2 Webpack Express Starter ', 27 | baseUrl: '/', 28 | isDevServer: helpers.isWebpackDevServer() 29 | }; 30 | 31 | module.exports = function(options) { 32 | let isProd = options.env === 'production'; 33 | 34 | return { 35 | /** 36 | * 文件入口 37 | */ 38 | entry: { 39 | polyfills: './src/polyfills.ts', 40 | vendor: './src/vendor.ts', 41 | main: './src/main.ts' 42 | }, 43 | 44 | /** 45 | * 解析文件名 46 | */ 47 | resolve: { 48 | extensions: ['.ts', '.js', '.json'], 49 | 50 | modules: [helpers.root('src'), helpers.root('node_modules')] 51 | }, 52 | 53 | /** 54 | * 对不同模块文件处理 55 | */ 56 | module: { 57 | rules: [ 58 | /** 59 | * 处理 ts 文件 60 | * - angular2-template-loader 可以使得 ng2 组件内的 templateUrl|styleUrls 像这样使用: 61 | * templateUrl: './app.component.html' 62 | * styleUrls: ['./app.component.css'] 63 | */ 64 | { 65 | test: /\.ts$/, 66 | use: [ 67 | 'awesome-typescript-loader', 68 | 'angular2-template-loader', 69 | 'angular2-router-loader' 70 | ], 71 | exclude: [/\.(spec|e2e)\.ts$/] 72 | }, 73 | 74 | { 75 | test: /\.json$/, 76 | use: 'json-loader' 77 | }, 78 | 79 | /** 80 | * 处理全局 css 81 | */ 82 | { 83 | test: /\.css$/, 84 | loader: ExtractTextPlugin.extract({ 85 | fallbackLoader: 'style-loader', 86 | loader: ['css-loader?modules&importLoaders=1', 'postcss-loader?sourceMap=inline'] 87 | }), 88 | exclude: [helpers.root('src', 'app')], 89 | }, 90 | 91 | /** 92 | * 处理组件内 css 93 | */ 94 | { 95 | test: /\.css$/, 96 | include: helpers.root('src', 'app'), 97 | use: ['to-string-loader', 'css-loader?modules&importLoaders=1', 'postcss-loader?sourceMap=inline'] 98 | }, 99 | 100 | /** 101 | * 处理图片 102 | */ 103 | { 104 | test: /\.(jpg|png|gif)$/, 105 | use: 'file-loader' 106 | }, 107 | 108 | /** 109 | * 处理 html 110 | */ 111 | { 112 | test: /\.html$/, 113 | use: 'raw-loader', 114 | exclude: [helpers.root('src', 'index.html')] 115 | } 116 | ] 117 | }, 118 | 119 | plugins: [ 120 | /** 121 | * 资源文件 122 | */ 123 | new AssetsPlugin({ 124 | path: helpers.root('dist'), 125 | filename: 'webpack-assets.json', 126 | prettyPrint: true 127 | }), 128 | 129 | /** 130 | * 分离 css 文件 131 | */ 132 | new ExtractTextPlugin({ 133 | filename: '[name].bundle.css', 134 | allChunks: true 135 | }), 136 | 137 | /** 138 | * 将 typescript 的类型检查分离出在另一个进程, 139 | * 这样在打包 webpack 时候不需要等待 140 | */ 141 | new ForkCheckerPlugin(), 142 | 143 | /** 144 | * 提取公共部分文件 145 | */ 146 | new CommonsChunkPlugin({ 147 | name: ['polyfills', 'vendor'].reverse() 148 | }), 149 | 150 | new ContextReplacementPlugin( 151 | // The (\\|\/) piece accounts for path separators in *nix and Windows 152 | /angular(\\|\/)core(\\|\/)src(\\|\/)linker/, 153 | helpers.root('src'), // location of your src 154 | { 155 | // your Angular Async Route paths relative to this root directory 156 | } 157 | ), 158 | 159 | /** 160 | * 将一些不需要处理的资源拷贝出来 161 | */ 162 | new CopyWebpackPlugin([{ 163 | from: 'src/assets', 164 | to: 'assets' 165 | }]), 166 | 167 | /** 168 | * 为 html 提供一些元数据 169 | */ 170 | new HtmlWebpackPlugin({ 171 | template: 'src/index.html', 172 | title: METADATA.title, 173 | chunksSortMode: 'dependency', 174 | metadata: METADATA, 175 | inject: 'head' 176 | }), 177 | 178 | /** 179 | * angular 有时会在 domready 事件之前运行 180 | * 会报 The Selector '' did not match any elements 的错误 181 | */ 182 | new ScriptExtHtmlWebpackPlugin({ 183 | defaultAttribute: 'defer' 184 | }), 185 | 186 | // Fix Angular 2 187 | new NormalModuleReplacementPlugin( 188 | /facade(\\|\/)async/, 189 | helpers.root('node_modules/@angular/core/src/facade/async.js') 190 | ), 191 | new NormalModuleReplacementPlugin( 192 | /facade(\\|\/)collection/, 193 | helpers.root('node_modules/@angular/core/src/facade/collection.js') 194 | ), 195 | new NormalModuleReplacementPlugin( 196 | /facade(\\|\/)errors/, 197 | helpers.root('node_modules/@angular/core/src/facade/errors.js') 198 | ), 199 | new NormalModuleReplacementPlugin( 200 | /facade(\\|\/)lang/, 201 | helpers.root('node_modules/@angular/core/src/facade/lang.js') 202 | ), 203 | new NormalModuleReplacementPlugin( 204 | /facade(\\|\/)math/, 205 | helpers.root('node_modules/@angular/core/src/facade/math.js') 206 | ) 207 | ], 208 | 209 | node: { 210 | global: true, 211 | crypto: 'empty', 212 | process: true, 213 | module: false, 214 | clearImmediate: false, 215 | setImmediate: false 216 | } 217 | 218 | }; 219 | } 220 | -------------------------------------------------------------------------------- /config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | */ 4 | 5 | const helpers = require('./helpers'); 6 | const webpackMerge = require('webpack-merge'); 7 | const commonConfig = require('./webpack.common'); 8 | 9 | /** 10 | * Webpack Plugins 11 | */ 12 | const DefinePlugin = require('webpack/lib/DefinePlugin'); 13 | const NamedModulesPlugin = require('webpack/lib/NamedModulesPlugin'); 14 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); 15 | 16 | /** 17 | * Webpack Constants 18 | */ 19 | const ENV = process.env.ENV = process.env.NODE_ENV = 'development'; 20 | const HOST = process.env.HOST || 'localhost'; 21 | const PORT = process.env.PORT || 3000; 22 | const HMR = helpers.hasProcessFlag('hot'); 23 | const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, { 24 | host: HOST, 25 | port: PORT, 26 | ENV: ENV, 27 | HMR: HMR 28 | }); 29 | 30 | module.exports = function() { 31 | console.log(` 32 | ---------------------------------------------------------- 33 | | 即将进行开发环境配置 | 34 | | **请注意开发环境的配置将不输出文件到本地** | 35 | ----------------------------------------------------------`); 36 | 37 | return webpackMerge(commonConfig({env: ENV}), { 38 | 39 | devtool: 'cheap-module-source-map', 40 | 41 | /** 42 | * 文件输出配置 43 | */ 44 | output: { 45 | // 输出路径 46 | path: helpers.root('dist'), 47 | // 输出每一个文件的名称 48 | filename: '[name].bundle.js', 49 | // map 文件名称 50 | sourceMapFilename: '[name].map', 51 | // The filename of non-entry chunks as relative path 52 | chunkFilename: '[id].chunk.js', 53 | 54 | library: 'ac_[name]', 55 | libraryTarget: 'var' 56 | }, 57 | 58 | plugins: [ 59 | /** 60 | * definePlugin 接收字符串插入到代码当中, 所以你需要的话可以写上 JS 的字符串 61 | */ 62 | new DefinePlugin({ 63 | 'ENV': JSON.stringify(METADATA.ENV), 64 | 'HMR': METADATA.HMR, 65 | 'process.env': { 66 | 'ENV': JSON.stringify(METADATA.ENV), 67 | 'NODE_ENV': JSON.stringify(METADATA.ENV), 68 | 'HMR': METADATA.HMR 69 | } 70 | }), 71 | 72 | new LoaderOptionsPlugin({ 73 | debug: true, 74 | options: {} 75 | }), 76 | ], 77 | 78 | devServer: { 79 | port: METADATA.port, 80 | host: METADATA.host, 81 | compress: true, 82 | historyApiFallback: true, 83 | watchOptions: { 84 | aggregateTimeout: 300, 85 | poll: 1000 86 | }, 87 | contentBase: helpers.root('dist'), 88 | // 将 node 服务转接到 4000 端口 89 | // 这样就可以同时获得 webpack-dev-server 的实时刷新 90 | // 也能同时调试接口 91 | proxy: { 92 | '/api': { 93 | target: 'http://localhost:4000' 94 | } 95 | } 96 | }, 97 | 98 | node: { 99 | global: true, 100 | crypto: 'empty', 101 | process: true, 102 | module: false, 103 | clearImmediate: false, 104 | setImmediate: false 105 | } 106 | }); 107 | } 108 | -------------------------------------------------------------------------------- /config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | */ 4 | 5 | const helpers = require('./helpers'); 6 | const webpackMerge = require('webpack-merge'); // used to merge webpack configs 7 | const commonConfig = require('./webpack.common.js'); // the settings that are common to prod and dev 8 | 9 | /** 10 | * Webpack Plugins 11 | */ 12 | const DefinePlugin = require('webpack/lib/DefinePlugin'); 13 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin'); 14 | const NormalModuleReplacementPlugin = require('webpack/lib/NormalModuleReplacementPlugin'); 15 | const WebpackMd5Hash = require('webpack-md5-hash'); 16 | const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); 17 | 18 | /** 19 | * Webpack Constants 20 | */ 21 | const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; 22 | const HOST = process.env.HOST || 'localhost'; 23 | const PORT = process.env.PORT || 8080; 24 | const METADATA = webpackMerge(commonConfig({env: ENV}).metadata, { 25 | host: HOST, 26 | port: PORT, 27 | ENV: ENV, 28 | HMR: false 29 | }); 30 | 31 | module.exports = function() { 32 | console.log(` 33 | ------------------------------------------------ 34 | | 即将进行生产环境打包 | 35 | ------------------------------------------------`); 36 | 37 | return webpackMerge(commonConfig({env: ENV}), { 38 | 39 | devtool: 'source-map', 40 | 41 | /** 42 | * Options affecting the output of the compilation. 43 | * 44 | * See: http://webpack.github.io/docs/configuration.html#output 45 | */ 46 | output: { 47 | path: helpers.root('dist'), 48 | publicPath: '/', 49 | filename: '[name].[chunkhash].bundle.js', 50 | sourceMapFilename: '[name].[chunkhash].bundle.map', 51 | chunkFilename: '[id].[chunkhash].chunk.js' 52 | }, 53 | 54 | plugins: [ 55 | /** 56 | * Plugin: WebpackMd5Hash 57 | * Description: Plugin to replace a standard webpack chunkhash with md5. 58 | * 59 | * See: https://www.npmjs.com/package/webpack-md5-hash 60 | */ 61 | new WebpackMd5Hash(), 62 | 63 | new DefinePlugin({ 64 | 'ENV': JSON.stringify(METADATA.ENV), 65 | 'HMR': METADATA.HMR, 66 | 'process.env': { 67 | 'ENV': JSON.stringify(METADATA.ENV), 68 | 'NODE_ENV': JSON.stringify(METADATA.ENV), 69 | 'HMR': METADATA.HMR, 70 | } 71 | }), 72 | 73 | /** 74 | * Plugin: UglifyJsPlugin 75 | * Description: Minimize all JavaScript output of chunks. 76 | * Loaders are switched into minimizing mode. 77 | * 78 | * See: https://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin 79 | */ 80 | new UglifyJsPlugin({ 81 | // beautify: true, //debug 82 | // mangle: false, //debug 83 | // dead_code: false, //debug 84 | // unused: false, //debug 85 | // deadCode: false, //debug 86 | // compress: { 87 | // screw_ie8: true, 88 | // keep_fnames: true, 89 | // drop_debugger: false, 90 | // dead_code: false, 91 | // unused: false 92 | // }, // debug 93 | // comments: true, //debug 94 | 95 | 96 | beautify: false, //prod 97 | output: { 98 | comments: false 99 | }, //prod 100 | mangle: { 101 | screw_ie8: true 102 | }, //prod 103 | compress: { 104 | screw_ie8: true, 105 | warnings: false, 106 | conditionals: true, 107 | unused: true, 108 | comparisons: true, 109 | sequences: true, 110 | dead_code: true, 111 | evaluate: true, 112 | if_return: true, 113 | join_vars: true, 114 | negate_iife: false // we need this for lazy v8 115 | }, 116 | }), 117 | 118 | /** 119 | * Plugin: NormalModuleReplacementPlugin 120 | * Description: Replace resources that matches resourceRegExp with newResource 121 | * 122 | * See: http://webpack.github.io/docs/list-of-plugins.html#normalmodulereplacementplugin 123 | */ 124 | new NormalModuleReplacementPlugin( 125 | /angular2-hmr/, 126 | helpers.root('config/empty.js') 127 | ), 128 | 129 | new NormalModuleReplacementPlugin( 130 | /zone\.js(\\|\/)dist(\\|\/)long-stack-trace-zone/, 131 | helpers.root('config/empty.js') 132 | ), 133 | 134 | new LoaderOptionsPlugin({ 135 | minimize: true, 136 | debug: false, 137 | options: { 138 | 139 | /** 140 | * Html loader advanced options 141 | * 142 | * See: https://github.com/webpack/html-loader#advanced-options 143 | */ 144 | // TODO: Need to workaround Angular 2's html syntax => #id [bind] (event) *ngFor 145 | htmlLoader: { 146 | minimize: true, 147 | removeAttributeQuotes: false, 148 | caseSensitive: true, 149 | customAttrSurround: [ 150 | [/#/, /(?:)/], 151 | [/\*/, /(?:)/], 152 | [/\[?\(?/, /(?:)/] 153 | ], 154 | customAttrAssign: [/\)?\]?=/] 155 | }, 156 | 157 | } 158 | }), 159 | ], 160 | 161 | node: { 162 | global: true, 163 | crypto: 'empty', 164 | process: false, 165 | module: false, 166 | clearImmediate: false, 167 | setImmediate: false 168 | } 169 | }); 170 | } 171 | -------------------------------------------------------------------------------- /dist/0.45b172136a7c1bd0d55f.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],{979:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,c=arguments.length,i=c<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var f=t.length-1;f>=0;f--)(r=t[f])&&(i=(c<3?r(i):c>3?r(e,o,i):r(e,o))||i);return c>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},c=o(1),i=o(450),f=o(982),a=o(985),u=function(){function t(){}return t}();u=n([c.NgModule({imports:[i.SharedModule,a.routing],declarations:[f.LoginPage]}),r("design:paramtypes",[])],u),e.LoginModule=u},982:function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,c=arguments.length,i=c<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,n);else for(var f=t.length-1;f>=0;f--)(r=t[f])&&(i=(c<3?r(i):c>3?r(e,o,i):r(e,o))||i);return c>3&&i&&Object.defineProperty(e,o,i),i},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},c=o(1),i=function(){function t(){}return t}();i=n([c.Component({selector:"login-page",template:o(989),styles:[o(991)]}),r("design:paramtypes",[])],i),e.LoginPage=i},985:function(t,e,o){"use strict";var n=o(132),r=o(982),c=[{path:"",component:r.LoginPage}];e.routing=n.RouterModule.forChild(c)},987:function(t,e,o){e=t.exports=o(278)(),e.push([t.i,"",""])},989:function(t,e){t.exports="

Login Module

\n\n

这是登录页

"},991:function(t,e,o){var n=o(987);"string"==typeof n?t.exports=n:t.exports=n.toString()}}); -------------------------------------------------------------------------------- /dist/1.9b630c58fb2b72f65559.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([1],{977:function(e,t,o){"use strict";var n=this&&this.__decorate||function(e,t,o,n){var r,c=arguments.length,f=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(f=(c<3?r(f):c>3?r(t,o,f):r(t,o))||f);return c>3&&f&&Object.defineProperty(t,o,f),f},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=o(1),f=o(450),a=o(980),i=o(983),u=function(){function e(){}return e}();u=n([c.NgModule({imports:[i.routing,f.SharedModule],declarations:[a.Page404]}),r("design:paramtypes",[])],u),Object.defineProperty(t,"__esModule",{value:!0}),t.default=u},980:function(e,t,o){"use strict";var n=this&&this.__decorate||function(e,t,o,n){var r,c=arguments.length,f=c<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)f=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(f=(c<3?r(f):c>3?r(t,o,f):r(t,o))||f);return c>3&&f&&Object.defineProperty(t,o,f),f},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=o(1),f=function(){function e(){}return e}();f=n([c.Component({selector:"page-404",template:o(988),styles:[o(990)]}),r("design:paramtypes",[])],f),t.Page404=f},983:function(e,t,o){"use strict";var n=o(132),r=o(980),c=[{path:"",component:r.Page404}];t.routing=n.RouterModule.forChild(c)},986:function(e,t,o){t=e.exports=o(278)(),t.push([e.i,"",""])},988:function(e,t){e.exports="

404 page

"},990:function(e,t,o){var n=o(986);"string"==typeof n?e.exports=n:e.exports=n.toString()}}); -------------------------------------------------------------------------------- /dist/2.c0d3a5740ddf41d4dd6b.chunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([2],{978:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,a=arguments.length,c=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var f=e.length-1;f>=0;f--)(r=e[f])&&(c=(a<3?r(c):a>3?r(t,n,c):r(t,n))||c);return a>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=n(1),c=n(450),f=n(981),i=n(984),l=function(){function e(){}return e}();l=o([a.NgModule({imports:[c.SharedModule,i.routing],declarations:[f.ExamplePage]}),r("design:paramtypes",[])],l),t.ExampleModule=l},981:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,a=arguments.length,c=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,n,o);else for(var f=e.length-1;f>=0;f--)(r=e[f])&&(c=(a<3?r(c):a>3?r(t,n,c):r(t,n))||c);return a>3&&c&&Object.defineProperty(t,n,c),c},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},a=n(1),c=function(){function e(){}return e}();c=o([a.Component({selector:"home-page",template:"\n

Example Module

\n\n

这是一个示例模块,旨在示范一个懒加载模块是怎样加载进来的。

\n"}),r("design:paramtypes",[])],c),t.ExamplePage=c},984:function(e,t,n){"use strict";var o=n(132),r=n(981),a=[{path:"",component:r.ExamplePage}];t.routing=o.RouterModule.forChild(a)}}); -------------------------------------------------------------------------------- /dist/assets/css/spin.css: -------------------------------------------------------------------------------- 1 | .spinner-container { 2 | width: 60px; 3 | height: 60px; 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | bottom: 60px; 8 | right: 0; 9 | margin: auto; 10 | -webkit-user-select: none; 11 | } 12 | 13 | .spinner { 14 | position: relative; 15 | 16 | width: 60px; 17 | height: 60px; 18 | margin: auto; 19 | } 20 | 21 | .double-bounce1, .double-bounce2 { 22 | position: absolute; 23 | top: 0; 24 | left: 0; 25 | 26 | width: 100%; 27 | height: 100%; 28 | border-radius: 50%; 29 | background-color: #ffffff; 30 | opacity: 0.6; 31 | 32 | -webkit-animation: sk-bounce 2.0s infinite ease-in-out; 33 | animation: sk-bounce 2.0s infinite ease-in-out; 34 | } 35 | 36 | .double-bounce2 { 37 | -webkit-animation-delay: -1.0s; 38 | animation-delay: -1.0s; 39 | } 40 | 41 | @-webkit-keyframes sk-bounce { 42 | 0%, 100% { -webkit-transform: scale(0.0) } 43 | 50% { -webkit-transform: scale(1.0) } 44 | } 45 | 46 | @keyframes sk-bounce { 47 | 0%, 100% { 48 | transform: scale(0.0); 49 | -webkit-transform: scale(0.0); 50 | } 50% { 51 | transform: scale(1.0); 52 | -webkit-transform: scale(1.0); 53 | } 54 | } -------------------------------------------------------------------------------- /dist/assets/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #253c51; 3 | color: #fff; 4 | } 5 | 6 | nav { 7 | height: 30px; 8 | line-height: 2; 9 | text-align: center; 10 | } 11 | 12 | nav a { 13 | display: inline-block; 14 | color: #12fff2; 15 | text-decoration: none; 16 | padding: 3px 23px; 17 | border: 1px solid; 18 | width: 80px; 19 | } 20 | 21 | nav a.active { 22 | color: #9dda1f; 23 | } 24 | 25 | .container { 26 | text-align: center; 27 | position: relative; 28 | top: 4rem; 29 | } -------------------------------------------------------------------------------- /dist/assets/images/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musicq/angular2-webpack-express-starter/d5fa2999ac2fbd425f57a5283a97521abfec9073/dist/assets/images/angular.png -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Angular2 Webpack Express Starter 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /dist/main.51d864a409cdc2b0a013.bundle.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([4],{113:function(t,e,n){"use strict";var r=n(48),o=n(64);n.d(e,"a",function(){return a});var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return n.i(o.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(o.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(o.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(r.a)},114:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(161),a=n(41),u=n(48),s=n(64);n.d(e,"a",function(){return f});var c=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},l={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},p=Promise.resolve(null),f=function(t){function e(e,r){t.call(this),this._submitted=!1,this.ngSubmit=new o.a,this.form=new i.a({},n.i(s.b)(e),n.i(s.c)(r))}return c(e,t),Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this;p.then(function(){var r=e._findContainer(t.path);t._control=r.registerControl(t.name,t.control),n.i(s.d)(t.control,t),t.control.updateValueAndValidity({emitEvent:!1})})},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e=this;p.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.addFormGroup=function(t){var e=this;p.then(function(){var r=e._findContainer(t.path),o=new i.a({});n.i(s.e)(o,t),r.registerControl(t.name,o),o.updateValueAndValidity({emitEvent:!1})})},e.prototype.removeFormGroup=function(t){var e=this;p.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this;p.then(function(){var r=n.form.get(t.path);r.setValue(e)})},e.prototype.setValue=function(t){this.control.setValue(t)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._findContainer=function(t){return t.pop(),t.length?this.form.get(t):this.form},e.decorators=[{type:r.Directive,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]",providers:[l],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]}]},e}(u.a)},115:function(t,e,n){"use strict";var r=n(1),o=n(34),i=n(77);n.d(e,"b",function(){return u}),n.d(e,"a",function(){return s});var a={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return s}),multi:!0},u=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&(t[0]._parent===e._control._parent&&t[1].name===e.name)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[]},t}(),s=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(i.a),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},t.decorators=[{type:r.Directive,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[a]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef},{type:u},{type:r.Injector}]},t.propDecorators={name:[{type:r.Input}],formControlName:[{type:r.Input}],value:[{type:r.Input}]},t}()},116:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(21),a=n(41),u=n(48),s=n(158),c=n(64);n.d(e,"a",function(){return f});var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},p={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},f=function(t){function e(e,n){t.call(this),this._validators=e,this._asyncValidators=n,this._submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new o.a}return l(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return n.i(c.d)(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){i.d.remove(this.directives,t)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);n.i(c.e)(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);n.i(c.e)(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this.form.get(t.path);n.setValue(e)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach(function(e){var r=t.form.get(e.path);e._control!==r&&(n.i(c.h)(e._control,e),r&&n.i(c.d)(r,e),e._control=r)}),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange(function(){return t._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=n.i(c.b)(this._validators);this.form.validator=a.a.compose([this.form.validator,t]);var e=n.i(c.c)(this._asyncValidators);this.form.asyncValidator=a.a.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){this.form||s.a.missingFormException()},e.decorators=[{type:r.Directive,args:[{selector:"[formGroup]",providers:[p],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]}]},e.propDecorators={form:[{type:r.Input,args:["formGroup"]}],ngSubmit:[{type:r.Output}]},e}(u.a)},117:function(t,e,n){"use strict";function r(t){return!(t instanceof h||t instanceof l.a||t instanceof y)}var o=n(1),i=n(41),a=n(113),u=n(48),s=n(158),c=n(64),l=n(116);n.d(e,"a",function(){return h}),n.d(e,"b",function(){return y});var p=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},f={provide:u.a,useExisting:n.i(o.forwardRef)(function(){return h})},h=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return p(e,t),e.prototype._checkParentType=function(){r(this._parent)&&s.a.groupParentException()},e.decorators=[{type:o.Directive,args:[{selector:"[formGroupName]",providers:[f]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:o.Optional},{type:o.Host},{type:o.SkipSelf}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.b]}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.c]}]}]},e.propDecorators={name:[{type:o.Input,args:["formGroupName"]}]},e}(a.a),d={provide:u.a,useExisting:n.i(o.forwardRef)(function(){return y})},y=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return p(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return n.i(c.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(c.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(c.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){r(this._parent)&&s.a.arrayParentException()},e.decorators=[{type:o.Directive,args:[{selector:"[formArrayName]",providers:[d]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:o.Optional},{type:o.Host},{type:o.SkipSelf}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.b]}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.c]}]}]},e.propDecorators={name:[{type:o.Input,args:["formArrayName"]}]},e}(u.a)},155:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},156:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},157:function(t,e,n){"use strict";var r=n(1),o=n(41),i=n(113),a=n(48),u=n(114),s=n(335);n.d(e,"a",function(){return p});var c=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},l={provide:a.a,useExisting:n.i(r.forwardRef)(function(){return p})},p=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return c(e,t),e.prototype._checkParentType=function(){this._parent instanceof e||this._parent instanceof u.a||s.a.modelGroupParentException()},e.decorators=[{type:r.Directive,args:[{selector:"[ngModelGroup]",providers:[l],exportAs:"ngModelGroup"}]}],e.ctorParameters=function(){return[{type:a.a,decorators:[{type:r.Host},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[o.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[o.c]}]}]},e.propDecorators={name:[{type:r.Input,args:["ngModelGroup"]}]},e}(i.a)},158:function(t,e,n){"use strict";var r=n(334);n.d(e,"a",function(){return o});var o=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formControlName)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n '+r.a.formGroupName+"\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n "+r.a.ngModelGroup)},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n "+r.a.formControlName)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formGroupName)},t.arrayParentException=function(){throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formArrayName)},t.disabledAttrWarning=function(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")},t}()},159:function(t,e,n){"use strict";function r(t,e){return null==t?""+e:(n.i(a.k)(e)||(e="Object"),(t+": "+e).slice(0,50))}function o(t){return t.split(":")[0]}var i=n(1),a=n(2),u=n(34);n.d(e,"a",function(){return c}),n.d(e,"b",function(){return l});var s={provide:u.a,useExisting:n.i(i.forwardRef)(function(){return c}),multi:!0},c=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this.value=t;var e=r(this._getOptionId(t),t);this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=n,t(e._getOptionValue(n))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){for(var e=0,r=Array.from(this._optionMap.keys());e-1)})}},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var o=n.selectedOptions,i=0;i0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(m),_=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n,r),this.controls=e,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return p(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this,r=void 0===e?{}:e,o=r.onlySelf,i=r.emitEvent;this._checkAllValuesPresent(t),t.forEach(function(t,e){n._throwIfControlMissing(e),n.at(e).setValue(t,{onlySelf:!0,emitEvent:i})}),this.updateValueAndValidity({onlySelf:o,emitEvent:i})},e.prototype.patchValue=function(t,e){var n=this,r=void 0===e?{}:e,o=r.onlySelf,i=r.emitEvent;t.forEach(function(t,e){n.at(e)&&n.at(e).patchValue(t,{onlySelf:!0,emitEvent:i})}),this.updateValueAndValidity({onlySelf:o,emitEvent:i})},e.prototype.reset=function(t,e){void 0===t&&(t=[]);var n=void 0===e?{}:e,r=n.onlySelf,o=n.emitEvent;this._forEachChild(function(e,n){e.reset(t[n],{onlySelf:!0,emitEvent:o})}),this.updateValueAndValidity({onlySelf:r,emitEvent:o}),this._updatePristine({onlySelf:r}),this._updateTouched({onlySelf:r})},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t.value})},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this._value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){for(var t=0,e=this.controls;t0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(m)},220:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){}return Object.defineProperty(t.prototype,"control",{get:function(){throw new Error("unimplemented")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return void 0===e&&(e=null),!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return void 0===e&&(e=null),this.control?this.control.getError(t,e):null},t}()},221:function(t,e,n){"use strict";var r=n(1),o=n(48),i=n(77);n.d(e,"a",function(){return c}),n.d(e,"b",function(){return l});var a=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},u=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),s={"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid","[class.ng-pending]":"ngClassPending"},c=function(t){function e(e){t.call(this,e)}return a(e,t),e.decorators=[{type:r.Directive,args:[{selector:"[formControlName],[ngModel],[formControl]",host:s}]}],e.ctorParameters=function(){return[{type:i.a,decorators:[{type:r.Self}]}]},e}(u),l=function(t){function e(e){t.call(this,e)}return a(e,t),e.decorators=[{type:r.Directive,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:s}]}],e.ctorParameters=function(){return[{type:o.a,decorators:[{type:r.Self}]}]},e}(u)},222:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(161),a=n(41),u=n(113),s=n(48),c=n(34),l=n(77),p=n(114),f=n(157),h=n(64),d=n(335);n.d(e,"a",function(){return v});var y=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},m={provide:l.a,useExisting:n.i(r.forwardRef)(function(){return v})},g=Promise.resolve(null),v=function(t){function e(e,r,a,u){t.call(this),this._control=new i.b,this._registered=!1,this.update=new o.a,this._parent=e,this._rawValidators=r||[],this._rawAsyncValidators=a||[],this.valueAccessor=n.i(h.f)(this,u)}return y(e,t),e.prototype.ngOnChanges=function(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),n.i(h.g)(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._parent?n.i(h.a)(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(h.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(h.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._setUpControl=function(){this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},e.prototype._isStandalone=function(){return!this._parent||this.options&&this.options.standalone},e.prototype._setUpStandalone=function(){n.i(h.d)(this._control,this),this._control.updateValueAndValidity({emitEvent:!1})},e.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},e.prototype._checkParentType=function(){!(this._parent instanceof f.a)&&this._parent instanceof u.a?d.a.formGroupNameException():this._parent instanceof f.a||this._parent instanceof p.a||d.a.modelParentException()},e.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||d.a.missingNameException()},e.prototype._updateValue=function(t){var e=this;g.then(function(){e.control.setValue(t,{emitViewToModelChange:!1})})},e.prototype._updateDisabled=function(t){var e=this,n=t.isDisabled.currentValue,r=""===n||n&&"false"!==n;g.then(function(){r&&!e.control.disabled?e.control.disable():!r&&e.control.disabled&&e.control.enable()})},e.decorators=[{type:r.Directive,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[m],exportAs:"ngModel"}]}],e.ctorParameters=function(){return[{type:s.a,decorators:[{type:r.Optional},{type:r.Host}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[c.a]}]}]},e.propDecorators={name:[{type:r.Input}],isDisabled:[{type:r.Input,args:["disabled"]}],model:[{type:r.Input,args:["ngModel"]}],options:[{type:r.Input,args:["ngModelOptions"]}],update:[{type:r.Output,args:["ngModelChange"]}]},e}(l.a)},223:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},224:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},225:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(41),a=n(34),u=n(77),s=n(158),c=n(64);n.d(e,"a",function(){return f});var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},p={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},f=function(t){function e(e,r,i){t.call(this),this.update=new o.a,this._rawValidators=e||[],this._rawAsyncValidators=r||[],this.valueAccessor=n.i(c.f)(this,i)}return l(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){s.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._isControlChanged(t)&&(n.i(c.d)(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),n.i(c.g)(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(c.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(c.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._isControlChanged=function(t){return t.hasOwnProperty("form")},e.decorators=[{type:r.Directive,args:[{selector:"[formControl]",providers:[p],exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.a]}]}]},e.propDecorators={form:[{type:r.Input,args:["formControl"]}],model:[{type:r.Input,args:["ngModel"]}],update:[{type:r.Output,args:["ngModelChange"]}],isDisabled:[{type:r.Input,args:["disabled"]}]},e}(u.a)},226:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(41),a=n(113),u=n(48),s=n(34),c=n(77),l=n(158),p=n(64),f=n(116),h=n(117);n.d(e,"a",function(){return m});var d=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},y={provide:c.a,useExisting:n.i(r.forwardRef)(function(){return m})},m=function(t){function e(e,r,i,a){t.call(this),this._added=!1,this.update=new o.a,this._parent=e,this._rawValidators=r||[],this._rawAsyncValidators=i||[],this.valueAccessor=n.i(p.f)(this,a)}return d(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){l.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._added||this._setUpControl(),n.i(p.g)(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return n.i(p.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(p.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(p.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof h.a)&&this._parent instanceof a.a?l.a.ngModelGroupException():this._parent instanceof h.a||this._parent instanceof f.a||this._parent instanceof h.b||l.a.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this._control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},e.decorators=[{type:r.Directive,args:[{selector:"[formControlName]",providers:[y]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:r.Optional},{type:r.Host},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[s.a]}]}]},e.propDecorators={name:[{type:r.Input,args:["formControlName"]}],model:[{type:r.Input,args:["ngModel"]}],update:[{type:r.Output,args:["ngModelChange"]}],isDisabled:[{type:r.Input,args:["disabled"]}]},e}(c.a)},227:function(t,e,n){"use strict";var r=n(1),o=n(41);n.d(e,"a",function(){return a}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return l}),n.d(e,"d",function(){return f});var i={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(){}return Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=null!=t&&t!==!1&&""+t!="false",this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),t.prototype.validate=function(t){return this.required?o.a.required(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:r.Directive,args:[{selector:"[required][formControlName],[required][formControl],[required][ngModel]",providers:[i],host:{"[attr.required]":'required ? "" : null'}}]}],t.ctorParameters=function(){return[]},t.propDecorators={required:[{type:r.Input}]},t}(),u={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return s}),multi:!0},s=function(){function t(){}return t.prototype.ngOnChanges=function(t){"minlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null==this.minlength?null:this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.minLength(parseInt(this.minlength,10))},t.decorators=[{type:r.Directive,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[u],host:{"[attr.minlength]":"minlength ? minlength : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={minlength:[{type:r.Input}]},t}(),c={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return l}),multi:!0},l=function(){function t(){}return t.prototype.ngOnChanges=function(t){"maxlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null!=this.maxlength?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.maxLength(parseInt(this.maxlength,10))},t.decorators=[{type:r.Directive,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[c],host:{"[attr.maxlength]":"maxlength ? maxlength : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={maxlength:[{type:r.Input}]},t}(),p={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return f}),multi:!0},f=function(){function t(){}return t.prototype.ngOnChanges=function(t){"pattern"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.pattern(this.pattern)},t.decorators=[{type:r.Directive,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[p],host:{"[attr.pattern]":"pattern ? pattern : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={pattern:[{type:r.Input}]},t}()},276:function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e\n \n \n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',formGroupName:'\n
\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',formArrayName:'\n
\n
\n
\n \n
\n
\n
\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });',ngModelGroup:'\n
\n
\n \n
\n
',ngModelWithFormGroup:'\n
\n \n \n
\n '}},335:function(t,e,n){"use strict";var r=n(334);n.d(e,"a",function(){return o});var o=function(){function t(){}return t.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n '+r.a.formControlName+"\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n "+r.a.ngModelWithFormGroup)},t.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+r.a.formGroupName+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+r.a.ngModelGroup)},t.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},t.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+r.a.formGroupName+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+r.a.ngModelGroup)},t}()},336:function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(161);n.d(e,"a",function(){return a});var a=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var r=this._reduceControls(t),a=n.i(o.d)(e)?e.validator:null,u=n.i(o.d)(e)?e.asyncValidator:null;return new i.a(r,a,u)},t.prototype.control=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),new i.b(t,e,n)},t.prototype.array=function(t,e,n){var r=this;void 0===e&&(e=null),void 0===n&&(n=null);var o=t.map(function(t){return r._createControl(t)});return new i.c(o,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return Object.keys(t).forEach(function(r){n[r]=e._createControl(t[r])}),n},t.prototype._createControl=function(t){if(t instanceof i.b||t instanceof i.a||t instanceof i.c)return t;if(Array.isArray(t)){var e=t[0],n=t.length>1?t[1]:null,r=t.length>2?t[2]:null;return this.control(e,n,r)}return this.control(t)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[]},t}()},337:function(t,e,n){"use strict";var r=n(1);n.d(e,"a",function(){return o});var o=r.__core_private__.isPromise},34:function(t,e,n){"use strict";var r=n(1); 3 | n.d(e,"a",function(){return o});var o=new r.OpaqueToken("NgValueAccessor")},361:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=function(){function t(){this.desc="首页"}return t}();a=r([i.Component({selector:"home-page",template:n(693),styles:[n(959)]}),o("design:paramtypes",[])],a),e.HomePage=a},41:function(t,e,n){"use strict";function r(t){return null==t||"string"==typeof t&&0===t.length}function o(t){return n.i(f.a)(t)?t:c.toPromise.call(t)}function i(t,e){return e.map(function(e){return e(t)})}function a(t,e){return e.map(function(e){return e(t)})}function u(t){var e=t.reduce(function(t,e){return n.i(p.d)(e)?l.e.merge(t,e):t},{});return 0===Object.keys(e).length?null:e}var s=n(1),c=n(407),l=(n.n(c),n(21)),p=n(2),f=n(337);n.d(e,"b",function(){return h}),n.d(e,"c",function(){return d}),n.d(e,"a",function(){return y});var h=new s.OpaqueToken("NgValidators"),d=new s.OpaqueToken("NgAsyncValidators"),y=function(){function t(){}return t.required=function(t){return r(t.value)?{required:!0}:null},t.minLength=function(t){return function(e){if(r(e.value))return null;var n="string"==typeof e.value?e.value.length:0;return nt?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){if(!e)return t.nullValidator;var n,o;return"string"==typeof e?(o="^"+e+"$",n=new RegExp(o)):(o=e.toString(),n=e),function(t){if(r(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:o,actualValue:e}}}},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(p.d);return 0==e.length?null:function(t){return u(i(t,e))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(p.d);return 0==e.length?null:function(t){var n=a(t,e).map(o);return Promise.all(n).then(u)}},t}()},420:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(100),u=n(185),s=n(537),c=n(536),l=n(535),p=n(538),f=function(){function t(){}return t}();f=r([i.NgModule({imports:[a.BrowserModule,u.HttpModule,s.CoreModule.forRoot(),p.HomeModule,c.routing],declarations:[l.AppComponent],providers:[c.appRoutingProviders],bootstrap:[l.AppComponent]}),o("design:paramtypes",[])],f),e.AppModule=f},423:function(t,e){t.exports={"spinner-container":"_2xDrZBPkkCrIhKUMrx9d_y",spinner:"_1x48j36gX2oVyFSCu51awa","double-bounce1":"_2McDtUctLWCEk_8Mbxffb_","double-bounce2":"_1Kg4-7HJgsVE58Pm1vhKF5","sk-bounce":"_3XwBgTuX-07JcT5O8_PVqs"}},424:function(t,e){t.exports={active:"_16vpJrnWqQO6AbNj7VwPFZ",container:"_2cSbuLtnX_cOrYSxeyUZme"}},427:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(85),u=n(500),s=function(){function t(){}return t}();s=r([i.NgModule({exports:[a.CommonModule,u.FormsModule]}),o("design:paramtypes",[])],s),e.SharedModule=s},48:function(t,e,n){"use strict";var r=n(220);n.d(e,"a",function(){return i});var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(){t.apply(this,arguments)}return o(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(r.a)},500:function(t,e,n){"use strict";var r=n(504);n.d(e,"FormGroupName",function(){return r.a}),n.d(e,"AbstractFormGroupDirective",function(){return r.b}),n.d(e,"CheckboxControlValueAccessor",function(){return r.c}),n.d(e,"ControlContainer",function(){return r.d}),n.d(e,"NG_VALUE_ACCESSOR",function(){return r.e}),n.d(e,"DefaultValueAccessor",function(){return r.f}),n.d(e,"NgControl",function(){return r.g}),n.d(e,"NgControlStatus",function(){return r.h}),n.d(e,"NgControlStatusGroup",function(){return r.i}),n.d(e,"NgForm",function(){return r.j}),n.d(e,"NgModel",function(){return r.k}),n.d(e,"NgModelGroup",function(){return r.l}),n.d(e,"RadioControlValueAccessor",function(){return r.m}),n.d(e,"FormControlDirective",function(){return r.n}),n.d(e,"FormControlName",function(){return r.o}),n.d(e,"FormGroupDirective",function(){return r.p}),n.d(e,"FormArrayName",function(){return r.q}),n.d(e,"AbstractControlDirective",function(){return r.r}),n.d(e,"NgSelectOption",function(){return r.s}),n.d(e,"SelectControlValueAccessor",function(){return r.t}),n.d(e,"SelectMultipleControlValueAccessor",function(){return r.u}),n.d(e,"MaxLengthValidator",function(){return r.v}),n.d(e,"MinLengthValidator",function(){return r.w}),n.d(e,"PatternValidator",function(){return r.x}),n.d(e,"RequiredValidator",function(){return r.y}),n.d(e,"FormBuilder",function(){return r.z}),n.d(e,"AbstractControl",function(){return r.A}),n.d(e,"FormArray",function(){return r.B}),n.d(e,"FormControl",function(){return r.C}),n.d(e,"FormGroup",function(){return r.D}),n.d(e,"NG_ASYNC_VALIDATORS",function(){return r.E}),n.d(e,"NG_VALIDATORS",function(){return r.F}),n.d(e,"Validators",function(){return r.G}),n.d(e,"VERSION",function(){return r.H}),n.d(e,"FormsModule",function(){return r.I}),n.d(e,"ReactiveFormsModule",function(){return r.J})},501:function(t,e,n){"use strict";var r=n(1),o=n(155),i=n(156),a=n(221),u=n(114),s=n(222),c=n(157),l=n(223),p=n(115),f=n(224),h=n(225),d=n(226),y=n(116),m=n(117),g=n(159),v=n(160),_=n(227);n(77);n.d(e,"a",function(){return C}),n.d(e,"c",function(){return O}),n.d(e,"b",function(){return V});var b=[g.b,v.b,i.a,l.a,f.a,o.a,g.a,v.a,p.a,a.a,a.b,_.a,_.b,_.c,_.d],C=[s.a,c.a,u.a],O=[h.a,y.a,d.a,m.a,m.b],V=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:b,exports:b}]}],t.ctorParameters=function(){return[]},t}()},502:function(t,e,n){"use strict";function r(t){return t.validate?function(e){return t.validate(e)}:t}function o(t){return t.validate?function(e){return t.validate(e)}:t}e.a=r,e.b=o},503:function(t,e,n){"use strict";var r=n(1),o=n(501),i=n(115),a=n(336);n.d(e,"a",function(){return u}),n.d(e,"b",function(){return s});var u=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:o.a,providers:[i.b],exports:[o.b,o.a]}]}],t.ctorParameters=function(){return[]},t}(),s=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:[o.c],providers:[a.a,i.b],exports:[o.b,o.c]}]}],t.ctorParameters=function(){return[]},t}()},504:function(t,e,n){"use strict";var r=n(220),o=n(113),i=n(155),a=n(48),u=n(34),s=n(156),c=n(77),l=n(221),p=n(114),f=n(222),h=n(157),d=n(115),y=n(225),m=n(226),g=n(116),v=n(117),_=n(159),b=n(160),C=n(227),O=n(336),V=n(161),w=n(41),E=n(505),P=n(503);n.d(e,"r",function(){return r.a}),n.d(e,"b",function(){return o.a}),n.d(e,"c",function(){return i.a}),n.d(e,"d",function(){return a.a}),n.d(e,"e",function(){return u.a}),n.d(e,"f",function(){return s.a}),n.d(e,"g",function(){return c.a}),n.d(e,"h",function(){return l.a}),n.d(e,"i",function(){return l.b}),n.d(e,"j",function(){return p.a}),n.d(e,"k",function(){return f.a}),n.d(e,"l",function(){return h.a}),n.d(e,"m",function(){return d.a}),n.d(e,"n",function(){return y.a}),n.d(e,"o",function(){return m.a}),n.d(e,"p",function(){return g.a}),n.d(e,"q",function(){return v.b}),n.d(e,"a",function(){return v.a}),n.d(e,"s",function(){return _.b}),n.d(e,"t",function(){return _.a}),n.d(e,"u",function(){return b.a}),n.d(e,"v",function(){return C.c}),n.d(e,"w",function(){return C.b}),n.d(e,"x",function(){return C.d}),n.d(e,"y",function(){return C.a}),n.d(e,"z",function(){return O.a}),n.d(e,"B",function(){return V.c}),n.d(e,"C",function(){return V.b}),n.d(e,"D",function(){return V.a}),n.d(e,"A",function(){return V.d}),n.d(e,"E",function(){return w.c}),n.d(e,"F",function(){return w.b}),n.d(e,"G",function(){return w.a}),n.d(e,"H",function(){return E.a}),n.d(e,"I",function(){return P.a}),n.d(e,"J",function(){return P.b})},505:function(t,e,n){"use strict";var r=n(1);n.d(e,"a",function(){return o});var o=new r.Version("2.3.0")},535:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(185),u=function(){function t(t){this.http=t}return t.prototype.ngOnInit=function(){var t=this;this.http.get("/api/example/example-api").map(function(t){console.log(t);var e=t.text();return e||""}).subscribe(function(e){console.log(e),t.title=e});var e=JSON.stringify({params1:"this is params1",params2:"this is params2"}),n=new a.Headers({"Content-Type":"application/json"}),r=new a.RequestOptions({headers:n});this.http.post("/api/example/example-api",e,r).map(function(t){console.log(t);var e=t.json();return e||""}).subscribe(function(t){console.log(t)})},t}();u=r([i.Component({selector:"mnt-app",template:n(692),styles:[n(958)]}),o("design:paramtypes",["function"==typeof(s="undefined"!=typeof a.Http&&a.Http)&&s||Object])],u),e.AppComponent=u;var s},536:function(t,e,n){"use strict";var r=n(132),o=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"example",loadChildren:function(){return new Promise(function(t){n.e(2).then(function(e){t(n(964).ExampleModule)}.bind(null,n)).catch(n.oe)})}},{path:"login",loadChildren:function(){return new Promise(function(t){n.e(0).then(function(e){t(n(965).LoginModule)}.bind(null,n)).catch(n.oe)})}},{path:"404",loadChildren:function(){return new Promise(function(t){n.e(1).then(function(e){t(n(963).Module404)}.bind(null,n)).catch(n.oe)})}},{path:"**",redirectTo:"/404",pathMatch:"full"}];e.appRoutingProviders=[],e.routing=r.RouterModule.forRoot(o)},537:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=this&&this.__param||function(t,e){return function(n,r){e(n,r,t)}},a=n(1),u=function(){function t(t){if(t)throw new Error("CoreModule 已经加载过了! 确保只在 AppModule 中 import 它。")}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();u=r([a.NgModule({}),i(0,a.Optional()),i(0,a.SkipSelf()),o("design:paramtypes",[u])],u),e.CoreModule=u},538:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(427),u=n(361),s=n(539),c=function(){function t(){}return t}();c=r([i.NgModule({imports:[a.SharedModule,s.routing],declarations:[u.HomePage]}),o("design:paramtypes",[])],c),e.HomeModule=c},539:function(t,e,n){"use strict";var r=n(132),o=n(361);e.routing=r.RouterModule.forChild([{path:"home",component:o.HomePage}])},64:function(t,e,n){"use strict";function r(t,e){return e.path.concat([t])}function o(t,e){t||s(e,"Cannot find control with"),e.valueAccessor||s(e,"No value accessor for form control with"),t.validator=y.a.compose([t.validator,e.validator]),t.asyncValidator=y.a.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),e.valueAccessor.registerOnChange(function(n){e.viewToModelUpdate(n),t.markAsDirty(),t.setValue(n,{emitModelToViewChange:!1})}),e.valueAccessor.registerOnTouched(function(){return t.markAsTouched()}),t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)}),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function i(t,e){e.valueAccessor.registerOnChange(function(){return u(e)}),e.valueAccessor.registerOnTouched(function(){return u(e)}),e._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),e._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),t&&t._clearChangeFns()}function a(t,e){n.i(d.c)(t)&&s(e,"Cannot find control with"),t.validator=y.a.compose([t.validator,e.validator]),t.asyncValidator=y.a.composeAsync([t.asyncValidator,e.asyncValidator])}function u(t){return s(t,"There is no FormControl instance attached to form control element with")}function s(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function c(t){return n.i(d.d)(t)?y.a.compose(t.map(v.a)):null}function l(t){return n.i(d.d)(t)?y.a.composeAsync(t.map(v.b)):null}function p(t,e){if(!t.hasOwnProperty("model"))return!1;var r=t.model;return!!r.isFirstChange()||!n.i(d.i)(e,r.currentValue)}function f(t){return w.some(function(e){return t.constructor===e})}function h(t,e){if(!e)return null;var n,r,o;return e.forEach(function(e){e.constructor===g.a?n=e:f(e)?(r&&s(t,"More than one built-in value accessor matches form control with"),r=e):(o&&s(t,"More than one custom value accessor matches form control with"),o=e)}),o?o:r?r:n?n:(s(t,"No valid value accessor for form control with"),null)}var d=n(2),y=n(41),m=n(155),g=n(156),v=n(502),_=n(223),b=n(115),C=n(224),O=n(159),V=n(160);e.a=r,e.d=o,e.h=i,e.e=a,e.b=c,e.c=l,e.g=p,e.f=h;var w=[m.a,C.a,_.a,O.a,V.a,b.a]},690:function(t,e,n){e=t.exports=n(276)(),e.push([t.i,"main{padding:1em;text-align:center;margin-top:50px;display:block}.k0U8uSgcQf-yqLZrfjd-w{max-width:800px;margin:0 auto}",""]),e.locals={sandbox:"k0U8uSgcQf-yqLZrfjd-w"}},691:function(t,e,n){e=t.exports=n(276)(),e.push([t.i,"span{color:#f08080}a{color:#1ea38b;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}a:hover{color:rgba(64,154,218,.54)}",""])},692:function(t,e){t.exports='
\n

Hello from Angular 2 App with Webpack

\n \n
\n\n
\n \n\n
\n \n
\n
\n'},693:function(t,e){t.exports='

Home Module

\n\n

这里是{{desc}},首页是应用启动时就会加载的模块

\n\n这里是 404 标签,测试 postcss'},77:function(t,e,n){"use strict";function r(){throw new Error("unimplemented")}var o=n(220);n.d(e,"a",function(){return a});var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(){t.apply(this,arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}return i(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return r()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return r()},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){},e}(o.a)},958:function(t,e,n){var r=n(690);"string"==typeof r?t.exports=r:t.exports=r.toString()},959:function(t,e,n){var r=n(691);"string"==typeof r?t.exports=r:t.exports=r.toString()},960:function(t,e,n){"use strict";n(424),n(423);var r=n(186),o=n(1),i=n(420);o.enableProdMode(),r.platformBrowserDynamic().bootstrapModule(i.AppModule)}},[960]); -------------------------------------------------------------------------------- /dist/main.51d864a409cdc2b0a013.bundle.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"main.bundle.css","sourceRoot":""} -------------------------------------------------------------------------------- /dist/main.7d165cf2662242073743.bundle.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([4],{278:function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(1),a=function(){function e(){this.desc="首页"}return e}();a=o([i.Component({selector:"home-page",template:n(707),styles:[n(973)]}),r("design:paramtypes",[])],a),t.HomePage=a},427:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(1),a=n(97),c=n(186),u=n(559),f=n(558),s=n(557),p=n(560),l=function(){function e(){}return e}();l=o([i.NgModule({imports:[a.BrowserModule,c.HttpModule,u.CoreModule.forRoot(),p.HomeModule,f.routing],declarations:[s.AppComponent],providers:[f.appRoutingProviders],bootstrap:[s.AppComponent]}),r("design:paramtypes",[])],l),t.AppModule=l},446:function(e,t){e.exports={"spinner-container":"_2xDrZBPkkCrIhKUMrx9d_y",spinner:"_1x48j36gX2oVyFSCu51awa","double-bounce1":"_2McDtUctLWCEk_8Mbxffb_","double-bounce2":"_1Kg4-7HJgsVE58Pm1vhKF5","sk-bounce":"_3XwBgTuX-07JcT5O8_PVqs"}},447:function(e,t){e.exports={active:"_16vpJrnWqQO6AbNj7VwPFZ",container:"_2cSbuLtnX_cOrYSxeyUZme"}},450:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(1),a=n(86),c=n(277),u=function(){function e(){}return e}();u=o([i.NgModule({exports:[a.CommonModule,c.FormsModule]}),r("design:paramtypes",[])],u),t.SharedModule=u},557:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(1),a=n(186),c=function(){function e(e){this.http=e}return e.prototype.ngOnInit=function(){var e=this;this.http.get("/api/example/example-api").map(function(e){console.log(e);var t=e.text();return t||""}).subscribe(function(t){console.log(t),e.title=t});var t=JSON.stringify({params1:"this is params1",params2:"this is params2"}),n=new a.Headers({"Content-Type":"application/json"}),o=new a.RequestOptions({headers:n});this.http.post("/api/example/example-api",t,o).map(function(e){console.log(e);var t=e.json();return t||""}).subscribe(function(e){console.log(e)})},e}();c=o([i.Component({selector:"mnt-app",template:n(706),styles:[n(972)]}),r("design:paramtypes",["function"==typeof(u="undefined"!=typeof a.Http&&a.Http)&&u||Object])],c),t.AppComponent=c;var u},558:function(e,t,n){"use strict";var o=n(132),r=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"example",loadChildren:function(){return new Promise(function(e){n.e(2).then(function(t){e(n(978).ExampleModule)}.bind(null,n)).catch(n.oe)})}},{path:"login",loadChildren:function(){return new Promise(function(e){n.e(0).then(function(t){e(n(979).LoginModule)}.bind(null,n)).catch(n.oe)})}},{path:"404",loadChildren:function(){return n.e(1).then(n.bind(null,977)).then(function(e){return e.default})}},{path:"**",redirectTo:"/404",pathMatch:"full"}];t.appRoutingProviders=[],t.routing=o.RouterModule.forRoot(r)},559:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(n,o){t(n,o,e)}},a=n(1),c=function(){function e(e){if(e)throw new Error("CoreModule 已经加载过了! 确保只在 AppModule 中 import 它。")}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();c=o([a.NgModule({}),i(0,a.Optional()),i(0,a.SkipSelf()),r("design:paramtypes",[c])],c),t.CoreModule=c},560:function(e,t,n){"use strict";var o=this&&this.__decorate||function(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(r=e[c])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=n(1),a=n(450),c=n(363),u=n(561),f=function(){function e(){}return e}();f=o([i.NgModule({imports:[a.SharedModule,u.routing],declarations:[c.HomePage]}),r("design:paramtypes",[])],f),t.HomeModule=f},561:function(e,t,n){"use strict";var o=n(132),r=n(363);t.routing=o.RouterModule.forChild([{path:"home",component:r.HomePage}])},704:function(e,t,n){t=e.exports=n(278)(),t.push([e.i,"main{padding:1em;text-align:center;margin-top:50px;display:block}.k0U8uSgcQf-yqLZrfjd-w{max-width:800px;margin:0 auto}",""]),t.locals={sandbox:"k0U8uSgcQf-yqLZrfjd-w"}},705:function(e,t,n){t=e.exports=n(278)(),t.push([e.i,"span{color:#f08080}a{color:#1ea38b;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}a:hover{color:rgba(64,154,218,.54)}",""])},706:function(e,t){e.exports='
\n

Hello from Angular 2 App with Webpack

\n \n
\n\n
\n \n\n
\n \n
\n
\n'},707:function(e,t){e.exports='

Home Module

\n\n

这里是{{desc}},首页是应用启动时就会加载的模块

\n\n这里是 404 标签,测试 postcss'},972:function(e,t,n){var o=n(704);"string"==typeof o?e.exports=o:e.exports=o.toString()},973:function(e,t,n){var o=n(705);"string"==typeof o?e.exports=o:e.exports=o.toString()},974:function(e,t,n){"use strict";n(447),n(446);var o=n(187),r=n(1),i=n(427);r.enableProdMode(),o.platformBrowserDynamic().bootstrapModule(i.AppModule)}},[974]); -------------------------------------------------------------------------------- /dist/main.7d165cf2662242073743.bundle.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"main.bundle.css","sourceRoot":""} -------------------------------------------------------------------------------- /dist/main.bundle.css: -------------------------------------------------------------------------------- 1 | body{background:#253c51;color:#fff}nav{height:30px;line-height:2;text-align:center}nav a{display:inline-block;color:#12fff2;text-decoration:none;padding:3px 23px;border:1px solid;width:80px}nav a._16vpJrnWqQO6AbNj7VwPFZ{color:#9dda1f}._2cSbuLtnX_cOrYSxeyUZme{text-align:center;position:relative;top:4rem}._2xDrZBPkkCrIhKUMrx9d_y{width:60px;height:60px;position:absolute;top:0;left:0;bottom:60px;right:0;margin:auto;-webkit-user-select:none}._1x48j36gX2oVyFSCu51awa{position:relative;width:60px;height:60px;margin:auto}._1Kg4-7HJgsVE58Pm1vhKF5,._2McDtUctLWCEk_8Mbxffb_{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:#fff;opacity:.6;-webkit-animation:_3XwBgTuX-07JcT5O8_PVqs 2s infinite ease-in-out;animation:_3XwBgTuX-07JcT5O8_PVqs 2s infinite ease-in-out}._1Kg4-7HJgsVE58Pm1vhKF5{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes _3XwBgTuX-07JcT5O8_PVqs{0%,to{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes _3XwBgTuX-07JcT5O8_PVqs{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}} 2 | /*# sourceMappingURL=main.7d165cf2662242073743.bundle.map*/ -------------------------------------------------------------------------------- /dist/main.e586795ebeaf73d6214d.bundle.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([4],{113:function(t,e,n){"use strict";var r=n(48),o=n(64);n.d(e,"a",function(){return a});var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(){t.apply(this,arguments)}return i(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return n.i(o.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(o.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(o.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(r.a)},114:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(161),a=n(41),u=n(48),s=n(64);n.d(e,"a",function(){return f});var c=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},l={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},p=Promise.resolve(null),f=function(t){function e(e,r){t.call(this),this._submitted=!1,this.ngSubmit=new o.a,this.form=new i.a({},n.i(s.b)(e),n.i(s.c)(r))}return c(e,t),Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this;p.then(function(){var r=e._findContainer(t.path);t._control=r.registerControl(t.name,t.control),n.i(s.d)(t.control,t),t.control.updateValueAndValidity({emitEvent:!1})})},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e=this;p.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.addFormGroup=function(t){var e=this;p.then(function(){var r=e._findContainer(t.path),o=new i.a({});n.i(s.e)(o,t),r.registerControl(t.name,o),o.updateValueAndValidity({emitEvent:!1})})},e.prototype.removeFormGroup=function(t){var e=this;p.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this;p.then(function(){var r=n.form.get(t.path);r.setValue(e)})},e.prototype.setValue=function(t){this.control.setValue(t)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._findContainer=function(t){return t.pop(),t.length?this.form.get(t):this.form},e.decorators=[{type:r.Directive,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]",providers:[l],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]}]},e}(u.a)},115:function(t,e,n){"use strict";var r=n(1),o=n(34),i=n(77);n.d(e,"b",function(){return u}),n.d(e,"a",function(){return s});var a={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return s}),multi:!0},u=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&(t[0]._parent===e._control._parent&&t[1].name===e.name)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[]},t}(),s=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(i.a),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},t.decorators=[{type:r.Directive,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[a]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef},{type:u},{type:r.Injector}]},t.propDecorators={name:[{type:r.Input}],formControlName:[{type:r.Input}],value:[{type:r.Input}]},t}()},116:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(21),a=n(41),u=n(48),s=n(158),c=n(64);n.d(e,"a",function(){return f});var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},p={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},f=function(t){function e(e,n){t.call(this),this._validators=e,this._asyncValidators=n,this._submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new o.a}return l(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return n.i(c.d)(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){i.d.remove(this.directives,t)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);n.i(c.e)(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);n.i(c.e)(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this.form.get(t.path);n.setValue(e)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach(function(e){var r=t.form.get(e.path);e._control!==r&&(n.i(c.h)(e._control,e),r&&n.i(c.d)(r,e),e._control=r)}),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange(function(){return t._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=n.i(c.b)(this._validators);this.form.validator=a.a.compose([this.form.validator,t]);var e=n.i(c.c)(this._asyncValidators);this.form.asyncValidator=a.a.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){this.form||s.a.missingFormException()},e.decorators=[{type:r.Directive,args:[{selector:"[formGroup]",providers:[p],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]}]},e.propDecorators={form:[{type:r.Input,args:["formGroup"]}],ngSubmit:[{type:r.Output}]},e}(u.a)},117:function(t,e,n){"use strict";function r(t){return!(t instanceof h||t instanceof l.a||t instanceof y)}var o=n(1),i=n(41),a=n(113),u=n(48),s=n(158),c=n(64),l=n(116);n.d(e,"a",function(){return h}),n.d(e,"b",function(){return y});var p=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},f={provide:u.a,useExisting:n.i(o.forwardRef)(function(){return h})},h=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return p(e,t),e.prototype._checkParentType=function(){r(this._parent)&&s.a.groupParentException()},e.decorators=[{type:o.Directive,args:[{selector:"[formGroupName]",providers:[f]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:o.Optional},{type:o.Host},{type:o.SkipSelf}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.b]}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.c]}]}]},e.propDecorators={name:[{type:o.Input,args:["formGroupName"]}]},e}(a.a),d={provide:u.a,useExisting:n.i(o.forwardRef)(function(){return y})},y=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return p(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return n.i(c.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(c.b)(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(c.c)(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){r(this._parent)&&s.a.arrayParentException()},e.decorators=[{type:o.Directive,args:[{selector:"[formArrayName]",providers:[d]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:o.Optional},{type:o.Host},{type:o.SkipSelf}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.b]}]},{type:Array,decorators:[{type:o.Optional},{type:o.Self},{type:o.Inject,args:[i.c]}]}]},e.propDecorators={name:[{type:o.Input,args:["formArrayName"]}]},e}(u.a)},155:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},156:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},157:function(t,e,n){"use strict";var r=n(1),o=n(41),i=n(113),a=n(48),u=n(114),s=n(335);n.d(e,"a",function(){return p});var c=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},l={provide:a.a,useExisting:n.i(r.forwardRef)(function(){return p})},p=function(t){function e(e,n,r){t.call(this),this._parent=e,this._validators=n,this._asyncValidators=r}return c(e,t),e.prototype._checkParentType=function(){this._parent instanceof e||this._parent instanceof u.a||s.a.modelGroupParentException()},e.decorators=[{type:r.Directive,args:[{selector:"[ngModelGroup]",providers:[l],exportAs:"ngModelGroup"}]}],e.ctorParameters=function(){return[{type:a.a,decorators:[{type:r.Host},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[o.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[o.c]}]}]},e.propDecorators={name:[{type:r.Input,args:["ngModelGroup"]}]},e}(i.a)},158:function(t,e,n){"use strict";var r=n(334);n.d(e,"a",function(){return o});var o=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formControlName)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n '+r.a.formGroupName+"\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n "+r.a.ngModelGroup)},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n "+r.a.formControlName)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formGroupName)},t.arrayParentException=function(){throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+r.a.formArrayName)},t.disabledAttrWarning=function(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")},t}()},159:function(t,e,n){"use strict";function r(t,e){return null==t?""+e:(n.i(a.k)(e)||(e="Object"),(t+": "+e).slice(0,50))}function o(t){return t.split(":")[0]}var i=n(1),a=n(2),u=n(34);n.d(e,"a",function(){return c}),n.d(e,"b",function(){return l});var s={provide:u.a,useExisting:n.i(i.forwardRef)(function(){return c}),multi:!0},c=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this.value=t;var e=r(this._getOptionId(t),t);this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=n,t(e._getOptionValue(n))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){for(var e=0,r=Array.from(this._optionMap.keys());e-1)})}},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var o=n.selectedOptions,i=0;i0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(m),_=function(t){function e(e,n,r){void 0===n&&(n=null),void 0===r&&(r=null),t.call(this,n,r),this.controls=e,this._initObservables(),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}return p(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this,r=void 0===e?{}:e,o=r.onlySelf,i=r.emitEvent;this._checkAllValuesPresent(t),t.forEach(function(t,e){n._throwIfControlMissing(e),n.at(e).setValue(t,{onlySelf:!0,emitEvent:i})}),this.updateValueAndValidity({onlySelf:o,emitEvent:i})},e.prototype.patchValue=function(t,e){var n=this,r=void 0===e?{}:e,o=r.onlySelf,i=r.emitEvent;t.forEach(function(t,e){n.at(e)&&n.at(e).patchValue(t,{onlySelf:!0,emitEvent:i})}),this.updateValueAndValidity({onlySelf:o,emitEvent:i})},e.prototype.reset=function(t,e){void 0===t&&(t=[]);var n=void 0===e?{}:e,r=n.onlySelf,o=n.emitEvent;this._forEachChild(function(e,n){e.reset(t[n],{onlySelf:!0,emitEvent:o})}),this.updateValueAndValidity({onlySelf:r,emitEvent:o}),this._updatePristine({onlySelf:r}),this._updateTouched({onlySelf:r})},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t.value})},e.prototype._throwIfControlMissing=function(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this._value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){for(var t=0,e=this.controls;t0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(m)},220:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){}return Object.defineProperty(t.prototype,"control",{get:function(){throw new Error("unimplemented")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return void 0===e&&(e=null),!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return void 0===e&&(e=null),this.control?this.control.getError(t,e):null},t}()},221:function(t,e,n){"use strict";var r=n(1),o=n(48),i=n(77);n.d(e,"a",function(){return c}),n.d(e,"b",function(){return l});var a=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},u=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),s={"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid","[class.ng-pending]":"ngClassPending"},c=function(t){function e(e){t.call(this,e)}return a(e,t),e.decorators=[{type:r.Directive,args:[{selector:"[formControlName],[ngModel],[formControl]",host:s}]}],e.ctorParameters=function(){return[{type:i.a,decorators:[{type:r.Self}]}]},e}(u),l=function(t){function e(e){t.call(this,e)}return a(e,t),e.decorators=[{type:r.Directive,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:s}]}],e.ctorParameters=function(){return[{type:o.a,decorators:[{type:r.Self}]}]},e}(u)},222:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(161),a=n(41),u=n(113),s=n(48),c=n(34),l=n(77),p=n(114),f=n(157),h=n(64),d=n(335);n.d(e,"a",function(){return v});var y=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},m={provide:l.a,useExisting:n.i(r.forwardRef)(function(){return v})},g=Promise.resolve(null),v=function(t){function e(e,r,a,u){t.call(this),this._control=new i.b,this._registered=!1,this.update=new o.a,this._parent=e,this._rawValidators=r||[],this._rawAsyncValidators=a||[],this.valueAccessor=n.i(h.f)(this,u)}return y(e,t),e.prototype.ngOnChanges=function(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),n.i(h.g)(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._parent?n.i(h.a)(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(h.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(h.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._setUpControl=function(){this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},e.prototype._isStandalone=function(){return!this._parent||this.options&&this.options.standalone},e.prototype._setUpStandalone=function(){n.i(h.d)(this._control,this),this._control.updateValueAndValidity({emitEvent:!1})},e.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},e.prototype._checkParentType=function(){!(this._parent instanceof f.a)&&this._parent instanceof u.a?d.a.formGroupNameException():this._parent instanceof f.a||this._parent instanceof p.a||d.a.modelParentException()},e.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||d.a.missingNameException()},e.prototype._updateValue=function(t){var e=this;g.then(function(){e.control.setValue(t,{emitViewToModelChange:!1})})},e.prototype._updateDisabled=function(t){var e=this,n=t.isDisabled.currentValue,r=""===n||n&&"false"!==n;g.then(function(){r&&!e.control.disabled?e.control.disable():!r&&e.control.disabled&&e.control.enable()})},e.decorators=[{type:r.Directive,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[m],exportAs:"ngModel"}]}],e.ctorParameters=function(){return[{type:s.a,decorators:[{type:r.Optional},{type:r.Host}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[c.a]}]}]},e.propDecorators={name:[{type:r.Input}],isDisabled:[{type:r.Input,args:["disabled"]}],model:[{type:r.Input,args:["ngModel"]}],options:[{type:r.Input,args:["ngModelOptions"]}],update:[{type:r.Output,args:["ngModelChange"]}]},e}(l.a)},223:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},224:function(t,e,n){"use strict";var r=n(1),o=n(34);n.d(e,"a",function(){return a});var i={provide:o.a,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.decorators=[{type:r.Directive,args:[{selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[i]}]}],t.ctorParameters=function(){return[{type:r.Renderer},{type:r.ElementRef}]},t}()},225:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(41),a=n(34),u=n(77),s=n(158),c=n(64);n.d(e,"a",function(){return f});var l=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},p={provide:u.a,useExisting:n.i(r.forwardRef)(function(){return f})},f=function(t){function e(e,r,i){t.call(this),this.update=new o.a,this._rawValidators=e||[],this._rawAsyncValidators=r||[],this.valueAccessor=n.i(c.f)(this,i)}return l(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){s.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._isControlChanged(t)&&(n.i(c.d)(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),n.i(c.g)(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(c.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(c.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._isControlChanged=function(t){return t.hasOwnProperty("form")},e.decorators=[{type:r.Directive,args:[{selector:"[formControl]",providers:[p],exportAs:"ngForm"}]}],e.ctorParameters=function(){return[{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[a.a]}]}]},e.propDecorators={form:[{type:r.Input,args:["formControl"]}],model:[{type:r.Input,args:["ngModel"]}],update:[{type:r.Output,args:["ngModelChange"]}],isDisabled:[{type:r.Input,args:["disabled"]}]},e}(u.a)},226:function(t,e,n){"use strict";var r=n(1),o=n(47),i=n(41),a=n(113),u=n(48),s=n(34),c=n(77),l=n(158),p=n(64),f=n(116),h=n(117);n.d(e,"a",function(){return m});var d=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},y={provide:c.a,useExisting:n.i(r.forwardRef)(function(){return m})},m=function(t){function e(e,r,i,a){t.call(this),this._added=!1,this.update=new o.a,this._parent=e,this._rawValidators=r||[],this._rawAsyncValidators=i||[],this.valueAccessor=n.i(p.f)(this,a)}return d(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){l.a.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._added||this._setUpControl(),n.i(p.g)(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return n.i(p.a)(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return n.i(p.b)(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return n.i(p.c)(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof h.a)&&this._parent instanceof a.a?l.a.ngModelGroupException():this._parent instanceof h.a||this._parent instanceof f.a||this._parent instanceof h.b||l.a.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this._control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},e.decorators=[{type:r.Directive,args:[{selector:"[formControlName]",providers:[y]}]}],e.ctorParameters=function(){return[{type:u.a,decorators:[{type:r.Optional},{type:r.Host},{type:r.SkipSelf}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.b]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[i.c]}]},{type:Array,decorators:[{type:r.Optional},{type:r.Self},{type:r.Inject,args:[s.a]}]}]},e.propDecorators={name:[{type:r.Input,args:["formControlName"]}],model:[{type:r.Input,args:["ngModel"]}],update:[{type:r.Output,args:["ngModelChange"]}],isDisabled:[{type:r.Input,args:["disabled"]}]},e}(c.a)},227:function(t,e,n){"use strict";var r=n(1),o=n(41);n.d(e,"a",function(){return a}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return l}),n.d(e,"d",function(){return f});var i={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return a}),multi:!0},a=function(){function t(){}return Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=null!=t&&t!==!1&&""+t!="false",this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),t.prototype.validate=function(t){return this.required?o.a.required(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.decorators=[{type:r.Directive,args:[{selector:"[required][formControlName],[required][formControl],[required][ngModel]",providers:[i],host:{"[attr.required]":'required ? "" : null'}}]}],t.ctorParameters=function(){return[]},t.propDecorators={required:[{type:r.Input}]},t}(),u={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return s}),multi:!0},s=function(){function t(){}return t.prototype.ngOnChanges=function(t){"minlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null==this.minlength?null:this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.minLength(parseInt(this.minlength,10))},t.decorators=[{type:r.Directive,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[u],host:{"[attr.minlength]":"minlength ? minlength : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={minlength:[{type:r.Input}]},t}(),c={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return l}),multi:!0},l=function(){function t(){}return t.prototype.ngOnChanges=function(t){"maxlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null!=this.maxlength?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.maxLength(parseInt(this.maxlength,10))},t.decorators=[{type:r.Directive,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[c],host:{"[attr.maxlength]":"maxlength ? maxlength : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={maxlength:[{type:r.Input}]},t}(),p={provide:o.b,useExisting:n.i(r.forwardRef)(function(){return f}),multi:!0},f=function(){function t(){}return t.prototype.ngOnChanges=function(t){"pattern"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=o.a.pattern(this.pattern)},t.decorators=[{type:r.Directive,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[p],host:{"[attr.pattern]":"pattern ? pattern : null"}}]}],t.ctorParameters=function(){return[]},t.propDecorators={pattern:[{type:r.Input}]},t}()},276:function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e\n \n \n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',formGroupName:'\n
\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',formArrayName:'\n
\n
\n
\n \n
\n
\n
\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });',ngModelGroup:'\n
\n
\n \n
\n
',ngModelWithFormGroup:'\n
\n \n \n
\n '}},335:function(t,e,n){"use strict";var r=n(334);n.d(e,"a",function(){return o});var o=function(){function t(){}return t.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n '+r.a.formControlName+"\n\n Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:\n\n Example:\n\n "+r.a.ngModelWithFormGroup)},t.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+r.a.formGroupName+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+r.a.ngModelGroup)},t.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},t.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+r.a.formGroupName+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+r.a.ngModelGroup)},t}()},336:function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(161);n.d(e,"a",function(){return a});var a=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var r=this._reduceControls(t),a=n.i(o.d)(e)?e.validator:null,u=n.i(o.d)(e)?e.asyncValidator:null;return new i.a(r,a,u)},t.prototype.control=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),new i.b(t,e,n)},t.prototype.array=function(t,e,n){var r=this;void 0===e&&(e=null),void 0===n&&(n=null);var o=t.map(function(t){return r._createControl(t)});return new i.c(o,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return Object.keys(t).forEach(function(r){n[r]=e._createControl(t[r])}),n},t.prototype._createControl=function(t){if(t instanceof i.b||t instanceof i.a||t instanceof i.c)return t;if(Array.isArray(t)){var e=t[0],n=t.length>1?t[1]:null,r=t.length>2?t[2]:null;return this.control(e,n,r)}return this.control(t)},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[]},t}()},337:function(t,e,n){"use strict";var r=n(1);n.d(e,"a",function(){return o});var o=r.__core_private__.isPromise},34:function(t,e,n){"use strict";var r=n(1); 3 | n.d(e,"a",function(){return o});var o=new r.OpaqueToken("NgValueAccessor")},361:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=function(){function t(){this.desc="首页"}return t}();a=r([i.Component({selector:"home-page",template:n(693),styles:[n(959)]}),o("design:paramtypes",[])],a),e.HomePage=a},41:function(t,e,n){"use strict";function r(t){return null==t||"string"==typeof t&&0===t.length}function o(t){return n.i(f.a)(t)?t:c.toPromise.call(t)}function i(t,e){return e.map(function(e){return e(t)})}function a(t,e){return e.map(function(e){return e(t)})}function u(t){var e=t.reduce(function(t,e){return n.i(p.d)(e)?l.e.merge(t,e):t},{});return 0===Object.keys(e).length?null:e}var s=n(1),c=n(407),l=(n.n(c),n(21)),p=n(2),f=n(337);n.d(e,"b",function(){return h}),n.d(e,"c",function(){return d}),n.d(e,"a",function(){return y});var h=new s.OpaqueToken("NgValidators"),d=new s.OpaqueToken("NgAsyncValidators"),y=function(){function t(){}return t.required=function(t){return r(t.value)?{required:!0}:null},t.minLength=function(t){return function(e){if(r(e.value))return null;var n="string"==typeof e.value?e.value.length:0;return nt?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){if(!e)return t.nullValidator;var n,o;return"string"==typeof e?(o="^"+e+"$",n=new RegExp(o)):(o=e.toString(),n=e),function(t){if(r(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:o,actualValue:e}}}},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(p.d);return 0==e.length?null:function(t){return u(i(t,e))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(p.d);return 0==e.length?null:function(t){var n=a(t,e).map(o);return Promise.all(n).then(u)}},t}()},420:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(100),u=n(185),s=n(537),c=n(536),l=n(535),p=n(538),f=function(){function t(){}return t}();f=r([i.NgModule({imports:[a.BrowserModule,u.HttpModule,s.CoreModule.forRoot(),p.HomeModule,c.routing],declarations:[l.AppComponent],providers:[c.appRoutingProviders],bootstrap:[l.AppComponent]}),o("design:paramtypes",[])],f),e.AppModule=f},423:function(t,e){t.exports={"spinner-container":"_2xDrZBPkkCrIhKUMrx9d_y",spinner:"_1x48j36gX2oVyFSCu51awa","double-bounce1":"_2McDtUctLWCEk_8Mbxffb_","double-bounce2":"_1Kg4-7HJgsVE58Pm1vhKF5","sk-bounce":"_3XwBgTuX-07JcT5O8_PVqs"}},424:function(t,e){t.exports={active:"_16vpJrnWqQO6AbNj7VwPFZ",container:"_2cSbuLtnX_cOrYSxeyUZme"}},427:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(85),u=n(500),s=function(){function t(){}return t}();s=r([i.NgModule({exports:[a.CommonModule,u.FormsModule]}),o("design:paramtypes",[])],s),e.SharedModule=s},48:function(t,e,n){"use strict";var r=n(220);n.d(e,"a",function(){return i});var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(t){function e(){t.apply(this,arguments)}return o(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(r.a)},500:function(t,e,n){"use strict";var r=n(504);n.d(e,"FormGroupName",function(){return r.a}),n.d(e,"AbstractFormGroupDirective",function(){return r.b}),n.d(e,"CheckboxControlValueAccessor",function(){return r.c}),n.d(e,"ControlContainer",function(){return r.d}),n.d(e,"NG_VALUE_ACCESSOR",function(){return r.e}),n.d(e,"DefaultValueAccessor",function(){return r.f}),n.d(e,"NgControl",function(){return r.g}),n.d(e,"NgControlStatus",function(){return r.h}),n.d(e,"NgControlStatusGroup",function(){return r.i}),n.d(e,"NgForm",function(){return r.j}),n.d(e,"NgModel",function(){return r.k}),n.d(e,"NgModelGroup",function(){return r.l}),n.d(e,"RadioControlValueAccessor",function(){return r.m}),n.d(e,"FormControlDirective",function(){return r.n}),n.d(e,"FormControlName",function(){return r.o}),n.d(e,"FormGroupDirective",function(){return r.p}),n.d(e,"FormArrayName",function(){return r.q}),n.d(e,"AbstractControlDirective",function(){return r.r}),n.d(e,"NgSelectOption",function(){return r.s}),n.d(e,"SelectControlValueAccessor",function(){return r.t}),n.d(e,"SelectMultipleControlValueAccessor",function(){return r.u}),n.d(e,"MaxLengthValidator",function(){return r.v}),n.d(e,"MinLengthValidator",function(){return r.w}),n.d(e,"PatternValidator",function(){return r.x}),n.d(e,"RequiredValidator",function(){return r.y}),n.d(e,"FormBuilder",function(){return r.z}),n.d(e,"AbstractControl",function(){return r.A}),n.d(e,"FormArray",function(){return r.B}),n.d(e,"FormControl",function(){return r.C}),n.d(e,"FormGroup",function(){return r.D}),n.d(e,"NG_ASYNC_VALIDATORS",function(){return r.E}),n.d(e,"NG_VALIDATORS",function(){return r.F}),n.d(e,"Validators",function(){return r.G}),n.d(e,"VERSION",function(){return r.H}),n.d(e,"FormsModule",function(){return r.I}),n.d(e,"ReactiveFormsModule",function(){return r.J})},501:function(t,e,n){"use strict";var r=n(1),o=n(155),i=n(156),a=n(221),u=n(114),s=n(222),c=n(157),l=n(223),p=n(115),f=n(224),h=n(225),d=n(226),y=n(116),m=n(117),g=n(159),v=n(160),_=n(227);n(77);n.d(e,"a",function(){return C}),n.d(e,"c",function(){return O}),n.d(e,"b",function(){return V});var b=[g.b,v.b,i.a,l.a,f.a,o.a,g.a,v.a,p.a,a.a,a.b,_.a,_.b,_.c,_.d],C=[s.a,c.a,u.a],O=[h.a,y.a,d.a,m.a,m.b],V=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:b,exports:b}]}],t.ctorParameters=function(){return[]},t}()},502:function(t,e,n){"use strict";function r(t){return t.validate?function(e){return t.validate(e)}:t}function o(t){return t.validate?function(e){return t.validate(e)}:t}e.a=r,e.b=o},503:function(t,e,n){"use strict";var r=n(1),o=n(501),i=n(115),a=n(336);n.d(e,"a",function(){return u}),n.d(e,"b",function(){return s});var u=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:o.a,providers:[i.b],exports:[o.b,o.a]}]}],t.ctorParameters=function(){return[]},t}(),s=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:[o.c],providers:[a.a,i.b],exports:[o.b,o.c]}]}],t.ctorParameters=function(){return[]},t}()},504:function(t,e,n){"use strict";var r=n(220),o=n(113),i=n(155),a=n(48),u=n(34),s=n(156),c=n(77),l=n(221),p=n(114),f=n(222),h=n(157),d=n(115),y=n(225),m=n(226),g=n(116),v=n(117),_=n(159),b=n(160),C=n(227),O=n(336),V=n(161),w=n(41),E=n(505),P=n(503);n.d(e,"r",function(){return r.a}),n.d(e,"b",function(){return o.a}),n.d(e,"c",function(){return i.a}),n.d(e,"d",function(){return a.a}),n.d(e,"e",function(){return u.a}),n.d(e,"f",function(){return s.a}),n.d(e,"g",function(){return c.a}),n.d(e,"h",function(){return l.a}),n.d(e,"i",function(){return l.b}),n.d(e,"j",function(){return p.a}),n.d(e,"k",function(){return f.a}),n.d(e,"l",function(){return h.a}),n.d(e,"m",function(){return d.a}),n.d(e,"n",function(){return y.a}),n.d(e,"o",function(){return m.a}),n.d(e,"p",function(){return g.a}),n.d(e,"q",function(){return v.b}),n.d(e,"a",function(){return v.a}),n.d(e,"s",function(){return _.b}),n.d(e,"t",function(){return _.a}),n.d(e,"u",function(){return b.a}),n.d(e,"v",function(){return C.c}),n.d(e,"w",function(){return C.b}),n.d(e,"x",function(){return C.d}),n.d(e,"y",function(){return C.a}),n.d(e,"z",function(){return O.a}),n.d(e,"B",function(){return V.c}),n.d(e,"C",function(){return V.b}),n.d(e,"D",function(){return V.a}),n.d(e,"A",function(){return V.d}),n.d(e,"E",function(){return w.c}),n.d(e,"F",function(){return w.b}),n.d(e,"G",function(){return w.a}),n.d(e,"H",function(){return E.a}),n.d(e,"I",function(){return P.a}),n.d(e,"J",function(){return P.b})},505:function(t,e,n){"use strict";var r=n(1);n.d(e,"a",function(){return o});var o=new r.Version("2.3.0")},535:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(185),u=function(){function t(t){this.http=t}return t.prototype.ngOnInit=function(){var t=this;this.http.get("/api/example/example-api").map(function(t){console.log(t);var e=t.text();return e||""}).subscribe(function(e){console.log(e),t.title=e});var e=JSON.stringify({params1:"this is params1",params2:"this is params2"}),n=new a.Headers({"Content-Type":"application/json"}),r=new a.RequestOptions({headers:n});this.http.post("/api/example/example-api",e,r).map(function(t){console.log(t);var e=t.json();return e||""}).subscribe(function(t){console.log(t)})},t}();u=r([i.Component({selector:"mnt-app",template:n(692),styles:[n(958)]}),o("design:paramtypes",["function"==typeof(s="undefined"!=typeof a.Http&&a.Http)&&s||Object])],u),e.AppComponent=u;var s},536:function(t,e,n){"use strict";var r=n(132),o=[{path:"",redirectTo:"home",pathMatch:"full"},{path:"example",loadChildren:function(){return new Promise(function(t){n.e(2).then(function(e){t(n(964).ExampleModule)}.bind(null,n)).catch(n.oe)})}},{path:"login",loadChildren:function(){return new Promise(function(t){n.e(0).then(function(e){t(n(965).LoginModule)}.bind(null,n)).catch(n.oe)})}},{path:"404",loadChildren:function(){return n.e(1).then(n.bind(null,963)).then(function(t){return t.default})}},{path:"**",redirectTo:"/404",pathMatch:"full"}];e.appRoutingProviders=[],e.routing=r.RouterModule.forRoot(o)},537:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=this&&this.__param||function(t,e){return function(n,r){e(n,r,t)}},a=n(1),u=function(){function t(t){if(t)throw new Error("CoreModule 已经加载过了! 确保只在 AppModule 中 import 它。")}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();u=r([a.NgModule({}),i(0,a.Optional()),i(0,a.SkipSelf()),o("design:paramtypes",[u])],u),e.CoreModule=u},538:function(t,e,n){"use strict";var r=this&&this.__decorate||function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=n(1),a=n(427),u=n(361),s=n(539),c=function(){function t(){}return t}();c=r([i.NgModule({imports:[a.SharedModule,s.routing],declarations:[u.HomePage]}),o("design:paramtypes",[])],c),e.HomeModule=c},539:function(t,e,n){"use strict";var r=n(132),o=n(361);e.routing=r.RouterModule.forChild([{path:"home",component:o.HomePage}])},64:function(t,e,n){"use strict";function r(t,e){return e.path.concat([t])}function o(t,e){t||s(e,"Cannot find control with"),e.valueAccessor||s(e,"No value accessor for form control with"),t.validator=y.a.compose([t.validator,e.validator]),t.asyncValidator=y.a.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),e.valueAccessor.registerOnChange(function(n){e.viewToModelUpdate(n),t.markAsDirty(),t.setValue(n,{emitModelToViewChange:!1})}),e.valueAccessor.registerOnTouched(function(){return t.markAsTouched()}),t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)}),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function i(t,e){e.valueAccessor.registerOnChange(function(){return u(e)}),e.valueAccessor.registerOnTouched(function(){return u(e)}),e._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),e._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),t&&t._clearChangeFns()}function a(t,e){n.i(d.c)(t)&&s(e,"Cannot find control with"),t.validator=y.a.compose([t.validator,e.validator]),t.asyncValidator=y.a.composeAsync([t.asyncValidator,e.asyncValidator])}function u(t){return s(t,"There is no FormControl instance attached to form control element with")}function s(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function c(t){return n.i(d.d)(t)?y.a.compose(t.map(v.a)):null}function l(t){return n.i(d.d)(t)?y.a.composeAsync(t.map(v.b)):null}function p(t,e){if(!t.hasOwnProperty("model"))return!1;var r=t.model;return!!r.isFirstChange()||!n.i(d.i)(e,r.currentValue)}function f(t){return w.some(function(e){return t.constructor===e})}function h(t,e){if(!e)return null;var n,r,o;return e.forEach(function(e){e.constructor===g.a?n=e:f(e)?(r&&s(t,"More than one built-in value accessor matches form control with"),r=e):(o&&s(t,"More than one custom value accessor matches form control with"),o=e)}),o?o:r?r:n?n:(s(t,"No valid value accessor for form control with"),null)}var d=n(2),y=n(41),m=n(155),g=n(156),v=n(502),_=n(223),b=n(115),C=n(224),O=n(159),V=n(160);e.a=r,e.d=o,e.h=i,e.e=a,e.b=c,e.c=l,e.g=p,e.f=h;var w=[m.a,C.a,_.a,O.a,V.a,b.a]},690:function(t,e,n){e=t.exports=n(276)(),e.push([t.i,"main{padding:1em;text-align:center;margin-top:50px;display:block}.k0U8uSgcQf-yqLZrfjd-w{max-width:800px;margin:0 auto}",""]),e.locals={sandbox:"k0U8uSgcQf-yqLZrfjd-w"}},691:function(t,e,n){e=t.exports=n(276)(),e.push([t.i,"span{color:#f08080}a{color:#1ea38b;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}a:hover{color:rgba(64,154,218,.54)}",""])},692:function(t,e){t.exports='
\n

Hello from Angular 2 App with Webpack

\n \n
\n\n
\n \n\n
\n \n
\n
\n'},693:function(t,e){t.exports='

Home Module

\n\n

这里是{{desc}},首页是应用启动时就会加载的模块

\n\n这里是 404 标签,测试 postcss'},77:function(t,e,n){"use strict";function r(){throw new Error("unimplemented")}var o=n(220);n.d(e,"a",function(){return a});var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(){t.apply(this,arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}return i(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return r()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return r()},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){},e}(o.a)},958:function(t,e,n){var r=n(690);"string"==typeof r?t.exports=r:t.exports=r.toString()},959:function(t,e,n){var r=n(691);"string"==typeof r?t.exports=r:t.exports=r.toString()},960:function(t,e,n){"use strict";n(424),n(423);var r=n(186),o=n(1),i=n(420);o.enableProdMode(),r.platformBrowserDynamic().bootstrapModule(i.AppModule)}},[960]); -------------------------------------------------------------------------------- /dist/main.e586795ebeaf73d6214d.bundle.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"main.bundle.css","sourceRoot":""} -------------------------------------------------------------------------------- /dist/webpack-assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "vendor": { 3 | "js": "/vendor.9c1dabb38951a890a6c6.bundle.js" 4 | }, 5 | "main": { 6 | "js": "/main.7d165cf2662242073743.bundle.js", 7 | "css": "/main.bundle.css" 8 | }, 9 | "polyfills": { 10 | "js": "/polyfills.82de470f112be9e1e549.bundle.js" 11 | } 12 | } -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musicq/angular2-webpack-express-starter/d5fa2999ac2fbd425f57a5283a97521abfec9073/favicon.ico -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-webpack-express-starter", 3 | "description": "angular2 webpack express starter", 4 | "version": "1.0.0", 5 | "scripts": { 6 | "start": "concurrently \"npm run start:hmr\" \"npm run server\"", 7 | "start:hmr": "npm run server:dev:hmr", 8 | "server": "NODE_ENV=development nodemon --use_strict bin/www", 9 | "server:dev": "webpack-dev-server --config ./config/webpack.dev.js --progress --profile --watch --content-base src/", 10 | "server:dev:hmr": "npm run server:dev -- --inline --hot", 11 | "server:prod": "pm2 start process.yml", 12 | "build:prod": "webpack --config ./config/webpack.prod.js --progress --profile --bail", 13 | "lint": "tslint \"src/**/*.ts\" -t verbose", 14 | "clean": "npm run rimraf -- dist", 15 | "rimraf": "rimraf" 16 | }, 17 | "dependencies": { 18 | "@angular/common": "^2.3.0", 19 | "@angular/compiler": "^2.3.0", 20 | "@angular/core": "^2.3.0", 21 | "@angular/forms": "^2.3.0", 22 | "@angular/http": "^2.3.0", 23 | "@angular/platform-browser": "^2.3.0", 24 | "@angular/platform-browser-dynamic": "^2.3.0", 25 | "@angular/router": "^3.3.0", 26 | "angular-in-memory-web-api": "^0.1.17", 27 | "body-parser": "~1.15.1", 28 | "compression": "^1.6.2", 29 | "cookie-parser": "^1.4.3", 30 | "core-js": "^2.4.1", 31 | "debug": "^2.3.3", 32 | "express": "^4.14.0", 33 | "helmet": "^3.1.0", 34 | "jade": "~1.11.0", 35 | "materialize-css": "^0.97.8", 36 | "morgan": "~1.7.0", 37 | "reflect-metadata": "^0.1.8", 38 | "rxjs": "^5.0.0-rc.4", 39 | "serve-favicon": "^2.3.2", 40 | "zone.js": "^0.7.2" 41 | }, 42 | "devDependencies": { 43 | "@types/core-js": "^0.9.35", 44 | "@types/hammerjs": "^2.0.33", 45 | "@types/jasmine": "^2.5.38", 46 | "@types/node": "^6.0.40", 47 | "@types/protractor": "^4.0.0", 48 | "@types/selenium-webdriver": "^2.53.36", 49 | "@types/source-map": "^0.5.0", 50 | "@types/systemjs": "^0.19.32", 51 | "@types/uglify-js": "^2.6.28", 52 | "@types/webpack": "^2.0.0", 53 | "angular2-router-loader": "^0.3.4", 54 | "angular2-template-loader": "^0.6.0", 55 | "assets-webpack-plugin": "^3.5.0", 56 | "autoprefixer": "^6.5.3", 57 | "awesome-typescript-loader": "^2.2.4", 58 | "codelyzer": "^2.0.0-beta.1", 59 | "concurrently": "^3.1.0", 60 | "copy-webpack-plugin": "^4.0.1", 61 | "css-loader": "^0.26.1", 62 | "extract-text-webpack-plugin": "^2.0.0-beta.4", 63 | "file-loader": "^0.9.0", 64 | "html-loader": "^0.4.4", 65 | "html-webpack-plugin": "^2.24.1", 66 | "jasmine-core": "^2.4.1", 67 | "json-loader": "^0.5.4", 68 | "karma": "^1.2.0", 69 | "karma-jasmine": "^1.0.2", 70 | "karma-phantomjs-launcher": "^1.0.2", 71 | "karma-sourcemap-loader": "^0.3.7", 72 | "karma-webpack": "^1.8.0", 73 | "nodemon": "^1.11.0", 74 | "null-loader": "^0.1.1", 75 | "postcss-load-config": "^1.0.0", 76 | "postcss-loader": "^1.2.0", 77 | "postcss-smart-import": "^0.6.0", 78 | "precss": "^1.4.0", 79 | "raw-loader": "^0.5.1", 80 | "rimraf": "^2.5.4", 81 | "script-ext-html-webpack-plugin": "^1.3.4", 82 | "string-replace-loader": "^1.0.5", 83 | "style-loader": "^0.13.1", 84 | "to-string-loader": "^1.1.5", 85 | "tslint": "^4.0.2", 86 | "typescript": "2.1.1", 87 | "webpack": "^2.1.0-beta.27", 88 | "webpack-dev-server": "^2.1.0-beta.11", 89 | "webpack-md5-hash": "0.0.5", 90 | "webpack-merge": "^1.0.2" 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('postcss-smart-import')({ /* ...options */ }), 4 | require('precss')({ /* ...options */ }), 5 | require('autoprefixer')({ /* ...options */ }) 6 | ] 7 | } -------------------------------------------------------------------------------- /process.yml: -------------------------------------------------------------------------------- 1 | # pm2 启动配置 2 | apps: 3 | - name: MNTCMSCloud v2.0 4 | script: bin/www 5 | exec_mode: cluster 6 | node_args: --use_strict -------------------------------------------------------------------------------- /routes/router.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | * @description 路由器 4 | */ 5 | 6 | const app = require('express')(); 7 | 8 | // 示例路由 9 | app.use('/example', require('../api/example')); 10 | 11 | module.exports = app; 12 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author musicq 3 | * @create 2016-9-26 4 | */ 5 | 6 | const express = require('express'); 7 | const path = require('path'); 8 | const favicon = require('serve-favicon'); 9 | const bodyParser = require('body-parser'); 10 | const helmet = require('helmet'); 11 | const compression = require('compression'); 12 | const cookieParser = require('cookie-parser'); 13 | 14 | const app = express(); 15 | 16 | app.use(compression()); 17 | app.use(helmet()); 18 | app.use(favicon(path.join(__dirname, 'favicon.ico'))); 19 | app.use(bodyParser.json()); 20 | app.use(cookieParser()); 21 | 22 | /** 23 | * 接口全部放在 /api 路径下 24 | */ 25 | app.use('/api', require('./routes/router')); 26 | 27 | /** 28 | * 配置环境 29 | * 30 | * NODE_ENV 变量: 31 | * [development | dev] 开发环境 32 | * [staging] 测试环境 33 | * [production | prod] 正式环境 34 | */ 35 | console.log('process.env.NODE_ENV:' + process.env.NODE_ENV); 36 | if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'dev') { 37 | console.log('开发环境'); 38 | } else { 39 | (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'prod') 40 | ? console.log('正式环境') 41 | : console.log('测试环境'); 42 | 43 | app.use(express.static(path.join(__dirname, 'dist'))); 44 | // 除开发环境外,其他环境(正式、测试)全都为下面入口 45 | // `**` 使得匹配到的全部路径都发送到 angular2 来启动程序 46 | app.use('**', express.static(path.join(__dirname, '/dist/index.html'))) 47 | } 48 | 49 | /** 50 | * 错误处理 51 | */ 52 | 53 | // 捕捉 404 错误 54 | app.use((req, res, next) => { 55 | let err = new Error('Not Found'); 56 | err.status = 404; 57 | next(err); 58 | }); 59 | 60 | // 处理错误,返回错误信息 61 | app.use((err, req, res, next) => { 62 | res.status(err.status || 500); 63 | res.json({ 64 | message: err.message, 65 | error : err 66 | }); 67 | }); 68 | 69 | module.exports = app; 70 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | main { 2 | padding: 1em; 3 | text-align: center; 4 | margin-top: 50px; 5 | display: block; 6 | } 7 | 8 | .sandbox { 9 | max-width: 800px; 10 | margin: 0 auto; 11 | } -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Hello from Angular 2 App with Webpack

3 | 4 |
5 | 6 |
7 | 12 | 13 |
14 | 15 |
16 |
17 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Http, Response, Headers, RequestOptions } from '@angular/http'; 3 | 4 | @Component({ 5 | selector: 'mnt-app', 6 | templateUrl: './app.component.html', 7 | styleUrls: ['./app.component.css'] 8 | }) 9 | export class AppComponent implements OnInit { 10 | title: string; 11 | 12 | constructor(private http: Http) {} 13 | 14 | ngOnInit() { 15 | this.http.get('/api/example/example-api') 16 | .map((res: Response) => { 17 | console.log(res); 18 | let body = res.text(); 19 | return body || ''; 20 | }) 21 | .subscribe(title => { 22 | console.log(title); 23 | this.title = title; 24 | }); 25 | 26 | 27 | let body = JSON.stringify({ 28 | params1: 'this is params1', 29 | params2: 'this is params2' 30 | }); 31 | let headers = new Headers({ 32 | 'Content-Type': 'application/json' 33 | }); 34 | let options = new RequestOptions({ 35 | headers: headers 36 | }); 37 | 38 | this.http.post('/api/example/example-api', body, options) 39 | .map((res: Response) => { 40 | console.log(res); 41 | let _body = res.json(); 42 | return _body || ''; 43 | }) 44 | .subscribe(resData => { 45 | console.log(resData); 46 | }); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | // 暂时 5 | import { HttpModule } from '@angular/http'; 6 | 7 | /* import 核心模块 */ 8 | import { CoreModule } from './core/core.module'; 9 | /* import App 路由 */ 10 | import { routing, appRoutingProviders } from './app.routing'; 11 | /* import 根组件 */ 12 | import { AppComponent } from './app.component'; 13 | /* import 特性模块 */ 14 | import { HomeModule } from './pages/home/home.module'; 15 | 16 | @NgModule({ 17 | imports: [ 18 | BrowserModule, 19 | HttpModule, 20 | CoreModule.forRoot(), 21 | HomeModule, 22 | routing 23 | ], 24 | declarations: [ 25 | AppComponent 26 | ], 27 | providers: [ 28 | appRoutingProviders 29 | ], 30 | bootstrap: [ AppComponent ] 31 | }) 32 | export class AppModule { } 33 | -------------------------------------------------------------------------------- /src/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | const appRoutes: Routes = [ 5 | { path: '', redirectTo: 'home', pathMatch: 'full' }, 6 | { path: 'example', loadChildren: './pages/+example/example.module#ExampleModule' }, 7 | { path: 'login', loadChildren: './pages/+login/login.module#LoginModule' }, 8 | { 9 | path: '404', 10 | // 使用 webpack2 自带的 System 引入模块 11 | loadChildren: () => System.import('./pages/+404/404.module').then((comp: any) => comp.default) 12 | }, 13 | { path: '**', redirectTo: '/404', pathMatch: 'full' } 14 | ]; 15 | 16 | export const appRoutingProviders: any[] = []; 17 | 18 | export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); 19 | -------------------------------------------------------------------------------- /src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; 2 | 3 | @NgModule({ 4 | 5 | }) 6 | export class CoreModule { 7 | 8 | static forRoot(): ModuleWithProviders { 9 | return { 10 | ngModule: CoreModule, 11 | providers: [] 12 | }; 13 | } 14 | 15 | constructor (@Optional() @SkipSelf() parentModule: CoreModule) { 16 | if (parentModule) { 17 | throw new Error( 18 | 'CoreModule 已经加载过了! 确保只在 AppModule 中 import 它。'); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/app/pages/+404/404.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | 3 | import { SharedModule } from '../../shared/shared.module'; 4 | import { Page404 } from './404.page'; 5 | 6 | import { routing } from './404.routing'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | routing, 11 | SharedModule 12 | ], 13 | declarations: [ 14 | Page404 15 | ] 16 | }) 17 | export default class Module404 {} 18 | -------------------------------------------------------------------------------- /src/app/pages/+404/404.page.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musicq/angular2-webpack-express-starter/d5fa2999ac2fbd425f57a5283a97521abfec9073/src/app/pages/+404/404.page.css -------------------------------------------------------------------------------- /src/app/pages/+404/404.page.html: -------------------------------------------------------------------------------- 1 |

404 page

-------------------------------------------------------------------------------- /src/app/pages/+404/404.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'page-404', 5 | templateUrl: './404.page.html', 6 | styleUrls: ['./404.page.css'] 7 | }) 8 | export class Page404 {} 9 | -------------------------------------------------------------------------------- /src/app/pages/+404/404.routing.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { Page404 } from './404.page'; 5 | 6 | const routers: Routes = [ 7 | { path: '', component: Page404 } 8 | ]; 9 | 10 | export const routing: ModuleWithProviders = RouterModule.forChild(routers); 11 | -------------------------------------------------------------------------------- /src/app/pages/+example/example.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | 4 | import { ExamplePage } from './example.page'; 5 | 6 | import { routing } from './example.routing'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | routing 12 | ], 13 | declarations: [ ExamplePage ] 14 | }) 15 | export class ExampleModule {} 16 | -------------------------------------------------------------------------------- /src/app/pages/+example/example.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'home-page', 5 | template: ` 6 |

Example Module

7 | 8 |

这是一个示例模块,旨在示范一个懒加载模块是怎样加载进来的。

9 | ` 10 | }) 11 | export class ExamplePage { 12 | } 13 | -------------------------------------------------------------------------------- /src/app/pages/+example/example.routing.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { ExamplePage } from './example.page'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: ExamplePage } 8 | ]; 9 | 10 | export const routing: ModuleWithProviders = RouterModule.forChild(routes); 11 | -------------------------------------------------------------------------------- /src/app/pages/+login/login.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | 4 | import { LoginPage } from './login.page'; 5 | 6 | import { routing } from './login.routing'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | routing 12 | ], 13 | declarations: [ 14 | LoginPage 15 | ] 16 | }) 17 | export class LoginModule {} 18 | -------------------------------------------------------------------------------- /src/app/pages/+login/login.page.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musicq/angular2-webpack-express-starter/d5fa2999ac2fbd425f57a5283a97521abfec9073/src/app/pages/+login/login.page.css -------------------------------------------------------------------------------- /src/app/pages/+login/login.page.html: -------------------------------------------------------------------------------- 1 |

Login Module

2 | 3 |

这是登录页

-------------------------------------------------------------------------------- /src/app/pages/+login/login.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'login-page', 5 | templateUrl: './login.page.html', 6 | styleUrls: ['./login.page.css'] 7 | }) 8 | export class LoginPage {} 9 | -------------------------------------------------------------------------------- /src/app/pages/+login/login.routing.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { LoginPage } from './login.page'; 5 | 6 | const routers: Routes = [ 7 | { path: '', component: LoginPage } 8 | ]; 9 | 10 | export const routing: ModuleWithProviders = RouterModule.forChild(routers); 11 | -------------------------------------------------------------------------------- /src/app/pages/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | 4 | import { HomePage } from './home.page'; 5 | 6 | import { routing } from './home.routing'; 7 | 8 | @NgModule({ 9 | imports: [ 10 | SharedModule, 11 | routing 12 | ], 13 | declarations: [ 14 | HomePage 15 | ] 16 | }) 17 | export class HomeModule {} 18 | -------------------------------------------------------------------------------- /src/app/pages/home/home.page.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --dark_blue: #409ada; 3 | } 4 | 5 | span { 6 | color: lightcoral; 7 | } 8 | 9 | a { 10 | color: #1ea38b; 11 | 12 | user-select: none; 13 | 14 | &:hover { 15 | color: color(var(--dark_blue) a(54%)); 16 | } 17 | } -------------------------------------------------------------------------------- /src/app/pages/home/home.page.html: -------------------------------------------------------------------------------- 1 |

Home Module

2 | 3 |

这里是{{desc}},首页是应用启动时就会加载的模块

4 | 5 | 这里是 404 标签,测试 postcss -------------------------------------------------------------------------------- /src/app/pages/home/home.page.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'home-page', 5 | templateUrl: './home.page.html', 6 | styleUrls: ['./home.page.css'] 7 | }) 8 | export class HomePage { 9 | desc: string = '首页'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/pages/home/home.routing.ts: -------------------------------------------------------------------------------- 1 | import { ModuleWithProviders } from '@angular/core'; 2 | import { RouterModule } from '@angular/router'; 3 | 4 | import { HomePage } from './home.page'; 5 | 6 | export const routing: ModuleWithProviders = RouterModule.forChild([ 7 | { path: 'home', component: HomePage } 8 | ]); 9 | -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FormsModule } from '@angular/forms'; 4 | 5 | @NgModule({ 6 | exports: [ 7 | CommonModule, 8 | FormsModule 9 | ] 10 | }) 11 | export class SharedModule {} 12 | -------------------------------------------------------------------------------- /src/assets/css/spin.css: -------------------------------------------------------------------------------- 1 | .spinner-container { 2 | width: 60px; 3 | height: 60px; 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | bottom: 60px; 8 | right: 0; 9 | margin: auto; 10 | -webkit-user-select: none; 11 | } 12 | 13 | .spinner { 14 | position: relative; 15 | 16 | width: 60px; 17 | height: 60px; 18 | margin: auto; 19 | } 20 | 21 | .double-bounce1, .double-bounce2 { 22 | position: absolute; 23 | top: 0; 24 | left: 0; 25 | 26 | width: 100%; 27 | height: 100%; 28 | border-radius: 50%; 29 | background-color: #ffffff; 30 | opacity: 0.6; 31 | 32 | -webkit-animation: sk-bounce 2.0s infinite ease-in-out; 33 | animation: sk-bounce 2.0s infinite ease-in-out; 34 | } 35 | 36 | .double-bounce2 { 37 | -webkit-animation-delay: -1.0s; 38 | animation-delay: -1.0s; 39 | } 40 | 41 | @-webkit-keyframes sk-bounce { 42 | 0%, 100% { -webkit-transform: scale(0.0) } 43 | 50% { -webkit-transform: scale(1.0) } 44 | } 45 | 46 | @keyframes sk-bounce { 47 | 0%, 100% { 48 | transform: scale(0.0); 49 | -webkit-transform: scale(0.0); 50 | } 50% { 51 | transform: scale(1.0); 52 | -webkit-transform: scale(1.0); 53 | } 54 | } -------------------------------------------------------------------------------- /src/assets/css/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #253c51; 3 | color: #fff; 4 | } 5 | 6 | nav { 7 | height: 30px; 8 | line-height: 2; 9 | text-align: center; 10 | } 11 | 12 | nav a { 13 | display: inline-block; 14 | color: #12fff2; 15 | text-decoration: none; 16 | padding: 3px 23px; 17 | border: 1px solid; 18 | width: 80px; 19 | } 20 | 21 | nav a.active { 22 | color: #9dda1f; 23 | } 24 | 25 | .container { 26 | text-align: center; 27 | position: relative; 28 | top: 4rem; 29 | } -------------------------------------------------------------------------------- /src/assets/images/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/musicq/angular2-webpack-express-starter/d5fa2999ac2fbd425f57a5283a97521abfec9073/src/assets/images/angular.png -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | <%= htmlWebpackPlugin.options.title %> 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 26 | <% if (htmlWebpackPlugin.options.metadata.isDevServer && htmlWebpackPlugin.options.metadata.HMR !== true) { %> 27 | 28 | 29 | <% } %> 30 | 31 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @import 应用级样式 3 | */ 4 | import './assets/css/styles.css'; 5 | import './assets/css/spin.css'; 6 | 7 | /** 8 | * @import 启动模块 9 | */ 10 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 11 | import { enableProdMode } from '@angular/core'; 12 | 13 | /** 14 | * @import 根模块 15 | */ 16 | import { AppModule } from './app/app.module'; 17 | 18 | if (process.env.ENV === 'production') enableProdMode(); 19 | 20 | platformBrowserDynamic().bootstrapModule(AppModule); 21 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 为了减小应用的大小,我们应该只引入我们用到的模块 3 | */ 4 | // import 'core-js/es6'; 5 | 6 | import 'core-js/es6/symbol'; 7 | import 'core-js/es6/object'; 8 | import 'core-js/es6/function'; 9 | import 'core-js/es6/parse-int'; 10 | import 'core-js/es6/parse-float'; 11 | import 'core-js/es6/number'; 12 | import 'core-js/es6/math'; 13 | import 'core-js/es6/string'; 14 | import 'core-js/es6/date'; 15 | import 'core-js/es6/array'; 16 | import 'core-js/es6/regexp'; 17 | import 'core-js/es6/map'; 18 | import 'core-js/es6/set'; 19 | import 'core-js/es6/weak-map'; 20 | import 'core-js/es6/weak-set'; 21 | import 'core-js/es6/typed'; 22 | import 'core-js/es6/reflect'; 23 | 24 | import 'core-js/es7/reflect'; 25 | import 'zone.js/dist/zone'; 26 | 27 | if (process.env.ENV === 'production') { 28 | // Production 29 | } else { 30 | // Development 31 | Error['stackTraceLimit'] = Infinity; 32 | require('zone.js/dist/long-stack-trace-zone'); 33 | } 34 | -------------------------------------------------------------------------------- /src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 2 | import '@angular/platform-browser'; 3 | import '@angular/platform-browser-dynamic'; 4 | import '@angular/core'; 5 | import '@angular/common'; 6 | import '@angular/forms'; 7 | import '@angular/http'; 8 | import '@angular/router'; 9 | 10 | // RxJS 11 | // 我们仍然需要只引入用到的模块,这里我把整个库都引入了 12 | import 'rxjs'; 13 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "emitDecoratorMetadata": true, 7 | "experimentalDecorators": true, 8 | "allowSyntheticDefaultImports": true, 9 | "sourceMap": true, 10 | "strictNullChecks": false, 11 | "baseUrl": "./src", 12 | "paths": { 13 | }, 14 | "lib": [ 15 | "dom", 16 | "es6" 17 | ], 18 | "types": [ 19 | "hammerjs", 20 | "jasmine", 21 | "node", 22 | "selenium-webdriver", 23 | "source-map", 24 | "uglify-js", 25 | "webpack", 26 | "systemjs" 27 | ] 28 | }, 29 | "exclude": [ 30 | "node_modules", 31 | "dist" 32 | ], 33 | "awesomeTypescriptLoaderOptions": { 34 | "forkChecker": true, 35 | "useWebpackText": true 36 | }, 37 | "compileOnSave": false, 38 | "buildOnSave": false 39 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "member-access": false, 7 | "member-ordering": [ 8 | true, 9 | "public-before-private", 10 | "static-before-instance", 11 | "variables-before-functions" 12 | ], 13 | "no-any": false, 14 | "no-inferrable-types": false, 15 | "no-internal-module": true, 16 | "no-var-requires": false, 17 | "typedef": false, 18 | "typedef-whitespace": [ 19 | true, 20 | { 21 | "call-signature": "nospace", 22 | "index-signature": "nospace", 23 | "parameter": "nospace", 24 | "property-declaration": "nospace", 25 | "variable-declaration": "nospace" 26 | }, 27 | { 28 | "call-signature": "space", 29 | "index-signature": "space", 30 | "parameter": "space", 31 | "property-declaration": "space", 32 | "variable-declaration": "space" 33 | } 34 | ], 35 | 36 | "ban": false, 37 | "curly": false, 38 | "forin": true, 39 | "label-position": true, 40 | "no-arg": true, 41 | "no-bitwise": true, 42 | "no-conditional-assignment": true, 43 | "no-console": [ 44 | true, 45 | "debug", 46 | "info", 47 | "time", 48 | "timeEnd", 49 | "trace" 50 | ], 51 | "no-construct": true, 52 | "no-debugger": true, 53 | "no-duplicate-variable": true, 54 | "no-empty": false, 55 | "no-eval": true, 56 | "no-null-keyword": false, 57 | "no-shadowed-variable": true, 58 | "no-string-literal": false, 59 | "no-switch-case-fall-through": true, 60 | "no-unused-expression": true, 61 | "no-use-before-declare": true, 62 | "no-var-keyword": true, 63 | "radix": true, 64 | "switch-default": true, 65 | "triple-equals": [ 66 | true, 67 | "allow-null-check" 68 | ], 69 | "eofline": true, 70 | "indent": [ 71 | true, 72 | "spaces" 73 | ], 74 | "max-line-length": [ 75 | true, 76 | 140 77 | ], 78 | "no-require-imports": false, 79 | "no-trailing-whitespace": true, 80 | "object-literal-sort-keys": false, 81 | "trailing-comma": [ 82 | true, 83 | { 84 | "multiline": false, 85 | "singleline": "never" 86 | } 87 | ], 88 | 89 | "align": false, 90 | "class-name": true, 91 | "comment-format": [ 92 | true, 93 | "check-space" 94 | ], 95 | "interface-name": false, 96 | "jsdoc-format": true, 97 | "no-consecutive-blank-lines": false, 98 | "one-line": [ 99 | false, 100 | "check-open-brace", 101 | "check-catch", 102 | "check-else", 103 | "check-finally", 104 | "check-whitespace" 105 | ], 106 | "quotemark": [ 107 | true, 108 | "single", 109 | "avoid-escape" 110 | ], 111 | "semicolon": [true, "always"], 112 | "variable-name": [ 113 | true, 114 | "check-format", 115 | "allow-leading-underscore", 116 | "ban-keywords" 117 | ], 118 | "whitespace": [ 119 | true, 120 | "check-branch", 121 | "check-decl", 122 | "check-operator", 123 | "check-separator", 124 | "check-type" 125 | ], 126 | "import-destructuring-spacing": true 127 | } 128 | } 129 | --------------------------------------------------------------------------------