我正在運行混合角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'?在構造函數 –