kittencup / angular2-ama-cn

angular2 随便问
691 stars 101 forks source link

Angular2 动态调用的组件如何传递参数 #121

Closed Imporial closed 8 years ago

Imporial commented 8 years ago

如何将参数传递给动态调用的组件?

Imporial commented 8 years ago
this.windowPromise.then((cr: ComponentRef) => {
        var site: 动态调用的组件 = cr.instance;
        // 获取鼠标位置
        site.mouseX = event.clientX;
        site.mouseY = event.clientY;
}

在手动加载之后调用 then 函数,类似如此

21

73