我正在运行混合角1应用程序和角2应用程序。我创建了一个组件ActivateAccount。当我运行这个应用程序。 我收到控制台错误,同时降级组件。 Cannot read property 'resolveComponentFactory' of undefined <activate-account class="ng-scope">
获取错误,同时降级角2组件
我搜索了与此错误有关的信息,但是我什么也没找到。
我指Using Angular Components from AngularJS Code
app.module.js
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule, downgradeComponent } from '@angular/upgrade/static';
import { HttpModule } from '@angular/http';
import { ActivateAccountComponent } from '/thinkshop/widgets2/thinkshopapplication/activateaccount/activateaccount.ts';
@NgModule({
imports: [
BrowserModule,
UpgradeModule ,
HttpModule
],
declarations: [
ActivateAccountComponent
],
entryComponents: [
ActivateAccountComponent
]
})
export class AppModule {
constructor(private upgrade: UpgradeModule) { }
ngDoBootstrap() {
var app= angular.module('IdeolveActivateAccount', ['ngMaterial', 'jlareau.bowser', 'validation.match', 'ngDialog', 'ngMessages']);
app.controller("ActivateAccountApp", loadActivateAccountApp);
angular.module('IdeolveActivateAccount').directive('activateAccount', downgradeComponent({ component: ActivateAccountComponent }));
app.component("ideolveformcomponent",{
bindings:{
showideolvelink: '<'
},
controller: 'ActivateAccountApp',
templateUrl: '/thinkshop/widgets2/thinkshopapplication/login/template/landingdisplay.html'
});
this.upgrade.bootstrap(document.body, ['IdeolveActivateAccount']);
}
}
activateaccount.ts
import { Component } from '@angular/core';
@Component({
selector: 'activate-account',
template: '<div class="ActivateAccountContainer marginlefttwentypx margintoptwentypx marginrighttwentypx marginbottomtwentypx heighthundredpercent"></div>'
})
export class ActivateAccountComponent {
constructor() {}
}
我觉得我失去了一些东西。我已经检查了所有我的代码对上述链接给出的教程,但我得到控制台错误。
您可以添加ActivateAccountService的代码吗? –
@JaroslawK。更新了问题。 –
为什么你没有在你的ActivateAccountService中声明'emailId'和'BASE_URL'?在构造函数 –