这是我原来问题的延续
stackoverflow.com/questions/44596418/angular-throws-expressionchangedafterithasbeencheckederror-with-textarea
这仍然没有解决。我重新创建了原始的plunkr来模拟实际项目,发现它与textarea无关。
当我通过单击列表中的项目进入详细信息页面时,抛出异常ExpressionChangedAfterItHasBeenCheckedError。仅当src/detailitems.ts的 CodeView在数组中有多个元素时才会发生这种情况。CodeView 项以详细形式定义字段。
import { FormBase } from './formbase'
import { ItemBase, TextboxItemBase } from './itembase'
export class CodeView extends FormBase {
static getItems() :ItemBase[] {
let items: ItemBase[] = [
new TextboxItemBase(
{
key: 'id',
label: 'ID',
value: '',
required: true,
enabled: false,
readOnly: true,
size: 36
}
)
,
new TextboxItemBase(
{
key: 'description',
label: 'Description',
required: true,
size: 20
}
)
];
return items;
}
}
Run Code Online (Sandbox Code Playgroud)
如果我修改代码使 CodeView 只有 1 …
我正在研究.net核心mvc + angular应用程序.mvc框架处理用户管理,当用户登陆应用程序的特定区域时,角度接管.因此,当我向网站添加一个angular-2(stats)应用程序时,它正在运行.我需要实现另一个功能,所以我在同一个解决方案中添加了另一个angular-2应用程序(实践).一切都很好.Angular-4出现了.所以更改了对angular-4的引用,因为我正在使用第二个角度应用程序没有检查第一个角度应用程序一段时间.现在,当我尝试运行第一个角应用程序(统计数据)时,我得到此错误,而第二个应用程序加载角度.
两个应用程序共享systemjs.config.js,package.json,tsconfig.json,typings.json.
错误:
Error: (SystemJS) exports is not defined
ReferenceError: exports is not defined
at eval (http://localhost:60660/apps/common/date.extentions.js:2:23)
at eval (<anonymous>)
at Object.eval (http://localhost:60660/apps/common/daterange.component.js:13:1)
at eval (http://localhost:60660/apps/common/daterange.component.js:40:4)
at eval (http://localhost:60660/apps/common/daterange.component.js:41:3)
at eval (<anonymous>)
Evaluating http://localhost:60660/apps/common/date.extentions.js
Evaluating http://localhost:60660/apps/common/daterange.component.js
Evaluating http://localhost:60660/apps/stats/app.module.js
Evaluating http://localhost:60660/apps/stats/main.js
Error loading http://localhost:60660/apps/stats/main.js
at eval (http://localhost:60660/apps/common/date.extentions.js:2:23)
at eval (<anonymous>)
at Object.eval (http://localhost:60660/apps/common/daterange.component.js:13:1)
at eval (http://localhost:60660/apps/common/daterange.component.js:40:4)
at eval (http://localhost:60660/apps/common/daterange.component.js:41:3)
at eval (<anonymous>)
Evaluating http://localhost:60660/apps/common/date.extentions.js
Evaluating http://localhost:60660/apps/common/daterange.component.js
Evaluating http://localhost:60660/apps/stats/app.module.js
Evaluating http://localhost:60660/apps/stats/main.js
Error loading http://localhost:60660/apps/stats/main.js
Run Code Online (Sandbox Code Playgroud)
systemjs.config.js
(function (global) {
System.config({
paths: …Run Code Online (Sandbox Code Playgroud)