-
2 votesanswersviews
未知的编译器选项'angularCompilerOptions'在角度2提前编译中
我正在尝试在this angular 2项目中使用AOT编译器 . 我收到错误: TypeError: this.compiler.compileModules 在执行命令时不是函数: "node_modules/.bin/ngc" -p tsconfig-aot.json . 如何解决这个问题? 重现步骤: 克隆这个回购:https://github.com/Angul... -
108 votesanswersviews
在Angular 2中等效$ compile
我想手动编译一些包含HTML的指令 . Angular 2中 $compile 的等价物是什么? 例如,在Angular 1中,我可以动态编译HTML片段并将其附加到DOM: var e = angular.element('<div directive></div>'); element.append(e); $compile(e)($scope); -
150 votesanswersviews
如何使用/创建动态模板来使用Angular 2.0编译动态组件?
我想 dynamically 创建 template . 这应该用于在 Runtime 构建 ComponentType 并将其放置(甚至替换)它在托管组件内的某个位置 . 直到RC4我使用 ComponentResolver ,但是使用RC5我收到消息: 不建议使用ComponentResolver进行动态编译 . 请将ComponentFactoryResolver与@ NgModule ...