【发布时间】:2019-05-15 19:11:12
【问题描述】:
我试图在我的click 事件中进行两次调用,其中一次调用用于我的组件,另一次用于我的javascript 函数。下面是我的代码:
事件点击角度:
<button type="button" class="btn btn-primary" (click)="Plans(); " [attr.aria-expanded]="!isCollapsed"
aria-controls="collapseBasic">Test</button>
我的组件.ts:
Plans(){
this.limparCombinadoList();
this.codCombinadoPadrao = "dgc" + this.value.toString();
this.service.combinadoTipoRisco(this.codCombinadoPadrao)
.subscribe(
result => {
this.coberturas = result.data;
this.premioFinalCobertura = result.premioFinalCombinado
this.processarDados(this.coberturas,this.premioFinalCobertura)
});
}
我的 Javascript 函数:
<script type="text/javascript">
function renderDiv(){
$.BrunoLeite.init('[data-animation]');
}
</script>
我的 javascript 文件
hs.onscroll-animation.js
(function($) {
'use strict';
$.BrunoLeite = {
/**
* Base configuration.
*
* @var Object _baseConfig
*/
_baseConfig: {
bounds: -100,
debounce: 50,
...
}}
【问题讨论】:
-
alerta2是否有任何理由不在角度范围内? -
@briosheje 是 javascript 中的一个示例调用
-
是的。我用我需要的东西更新了帖子。感谢您的支持。
-
您知道
angular有一个动画模块,是吗? angular.io/guide/animations -
@theheadrush,是的。我正在导入我在 hml5 / bootstrap 中的模板,在单击事件之后,我执行服务调用并使用新数据呈现子组件
标签: javascript angular html angular6 angular7