{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/8997","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/8997/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/8997/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/8997/events","html_url":"https://github.com/angular/angular-cli/issues/8997","id":284514085,"number":8997,"title":"touched/untouched not working with ng build --prod","user":{"login":"MaxGorshkov","id":14037804,"avatar_url":"https://avatars2.githubusercontent.com/u/14037804?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGorshkov","html_url":"https://github.com/MaxGorshkov","followers_url":"https://api.github.com/users/MaxGorshkov/followers","following_url":"https://api.github.com/users/MaxGorshkov/following{/other_user}","gists_url":"https://api.github.com/users/MaxGorshkov/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGorshkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGorshkov/subscriptions","organizations_url":"https://api.github.com/users/MaxGorshkov/orgs","repos_url":"https://api.github.com/users/MaxGorshkov/repos","events_url":"https://api.github.com/users/MaxGorshkov/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGorshkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2017-12-26T08:10:32Z","updated_at":"2017-12-26T21:40:10Z","closed_at":null,"author_association":"NONE","body":"### Versions\r\n```\r\nng --version\r\n\r\nAngular CLI: 1.6.2\r\nNode: 9.3.0\r\nOS: win32 x64\r\nAngular: 5.1.2\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... http, language-service, platform-browser\r\n... platform-browser-dynamic, router\r\n\r\n@angular/cli: 1.6.2\r\n@angular-devkit/build-optimizer: 0.0.36\r\n@angular-devkit/core: 0.0.22\r\n@angular-devkit/schematics: 0.0.42\r\n@ngtools/json-schema: 1.1.0\r\n@ngtools/webpack: 1.9.2\r\n@schematics/angular: 0.1.11\r\n@schematics/schematics: 0.0.11\r\ntypescript: 2.4.2\r\nwebpack: 3.10.0\r\n```\r\n\r\n### Repro steps\r\n* Step 1\r\nng new testProject\r\n* Step 2\r\ncd testProject\r\n* Step 3\r\nnpm install\r\n* Step 4\r\nadd code in /src/app/app.component.html:\r\n\r\n```\r\n  <li>\r\n    <h2><a target=\"_blank\" rel=\"noopener\" href=\"https://blog.angular.io/\">Angular blog</a></h2>\r\n  </li>\r\n  <!--my code begin-->\r\n  <li>\r\n    <div>\r\n      <label>field</label>\r\n      <input [(ngModel)]=\"model.field\" #field=\"ngModel\"/>\r\n    </div>\r\n  </li>\r\n  <li>\r\n    <div>untouched - {{field.untouched}} </div>\r\n    <div>pristine - {{field.pristine}} </div>\r\n  </li>\r\n  <!--my code end-->\r\n```\r\n* Step 5\r\nadd code in /src/app/app.component.ts:\r\n```\r\nexport class AppComponent {\r\n  title = 'app';\r\n  // my code begin\r\n  model = {\r\n    field: ''\r\n  };\r\n  // my code end\r\n}\r\n```\r\n* Step 6\r\nadd code in /src/app/app.module.ts:\r\n\r\n`import { FormsModule, ReactiveFormsModule } from '@angular/forms';`\r\n...\r\n```\r\n  imports: [\r\n    BrowserModule,\r\n    FormsModule,\r\n    ReactiveFormsModule\r\n  ],\r\n```\r\n* Step 7\r\nnpm run build\r\n\r\n### Observed behavior\r\n![wrong](https://user-images.githubusercontent.com/14037804/34351325-bf438ee4-ea3d-11e7-81e1-7a5595aec185.gif)\r\n\r\n\r\n### Desired behavior\r\nas after run ng serve:\r\n![success](https://user-images.githubusercontent.com/14037804/34351327-c3a6cbe0-ea3d-11e7-96f4-6087ebd79282.gif)\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/354015987","html_url":"https://github.com/angular/angular-cli/issues/8997#issuecomment-354015987","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/8997","id":354015987,"user":{"login":"Alekcei","id":11617585,"avatar_url":"https://avatars0.githubusercontent.com/u/11617585?v=4","gravatar_id":"","url":"https://api.github.com/users/Alekcei","html_url":"https://github.com/Alekcei","followers_url":"https://api.github.com/users/Alekcei/followers","following_url":"https://api.github.com/users/Alekcei/following{/other_user}","gists_url":"https://api.github.com/users/Alekcei/gists{/gist_id}","starred_url":"https://api.github.com/users/Alekcei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alekcei/subscriptions","organizations_url":"https://api.github.com/users/Alekcei/orgs","repos_url":"https://api.github.com/users/Alekcei/repos","events_url":"https://api.github.com/users/Alekcei/events{/privacy}","received_events_url":"https://api.github.com/users/Alekcei/received_events","type":"User","site_admin":false},"created_at":"2017-12-26T21:40:10Z","updated_at":"2017-12-26T21:40:10Z","author_association":"NONE","body":"But not working  `--no-build-optimizer`\r\n```\r\nERROR Error: No NgModule metadata found for 'function (){}'.\r\n    at t.TMtu.t.resolve (2.b2a6116….chunk.js:1)\r\n    at t.TMtu.t.getNgModuleMetadata (2.b2a6116….chunk.js:1)\r\n    at e.TMtu.t._loadModules (2.b2a6116….chunk.js:1)\r\n    at e.TMtu.t._compileModuleAndAllComponents (2.b2a6116….chunk.js:1)\r\n    at e.TMtu.t.compileModuleAndAllComponentsAsync (2.b2a6116….chunk.js:1)\r\n    at t.TMtu.t.compileModuleAndAllComponentsAsync (2.b2a6116….chunk.js:1)\r\n    at Function.TMtu.t.createDinamicPetitionOperationComponent (2.b2a6116….chunk.js:1)\r\n    at t.TMtu.t.createOperationsPetitionContent (2.b2a6116….chunk.js:1)\r\n    at e._next (2.b2a6116….chunk.js:1)\r\n    at e.E9/g.e.__tryOrUnsub (vendor.07efdf9….bundle.js:1)\r\n(anonymous) @ vendor.07efdf9….bundle.js:1\r\nLMZF.t.handleError @ vendor.07efdf9….bundle.js:1\r\nnext @ vendor.07efdf9….bundle.js:1\r\ne.object.i @ vendor.07efdf9….bundle.js:1\r\nE9/g.e.__tryOrUnsub @ vendor.07efdf9….bundle.js:1\r\nE9/g.e.next @ vendor.07efdf9….bundle.js:1\r\nE9/g.e._next @ vendor.07efdf9….bundle.js:1\r\nE9/g.e.next @ vendor.07efdf9….bundle.js:1\r\nTO51.e.next @ vendor.07efdf9….bundle.js:1\r\nLMZF.e.emit @ vendor.07efdf9….bundle.js:1\r\n(anonymous) @ vendor.07efdf9….bundle.js:1\r\nt.invoke @ polyfills.947cc91….bundle.js:1\r\nr.run @ polyfills.947cc91….bundle.js:1\r\nLMZF.t.runOutsideAngular @ vendor.07efdf9….bundle.js:1\r\nonHandleError @ vendor.07efdf9….bundle.js:1\r\nt.handleError @ polyfills.947cc91….bundle.js:1\r\nr.runTask @ polyfills.947cc91….bundle.js:1\r\ne.invokeTask @ polyfills.947cc91….bundle.js:1\r\nv @ polyfills.947cc91….bundle.js:1\r\nd @ polyfills.947cc91….bundle.js:1\r\n```\r\nagain missing MetaData"}}
{"actor":{"display_login":"Alekcei"}}