角事件,NG-点击,不与其他图书馆道场,淘汰赛,KendoUI,ESRI JSAPI工作 [英] Angular events, ng-click, do not work with other libraries Dojo, Knockout, KendoUI, ESRI JSAPI

查看:125
本文介绍了角事件,NG-点击,不与其他图书馆道场,淘汰赛,KendoUI,ESRI JSAPI工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从这个职位续 - 为什么NG-点击不行

Continued from this post - Why does ng-click not work?

所以我在非角应用程序转换为角的早期阶段。我们没有得到做一个干净的重新写的选项。

So I am in the early phases of converting a non-Angular application to Angular. We have not been given the option to do a clean re-write.

此应用程序使用道场,require.js,淘汰赛,ESRI JSAPI和KendoUI。这里使用的是简单plunker code:

This application uses Dojo, require.js, Knockout, ESRI JSAPI, and KendoUI. Using the simple plunker code here:

https://plnkr.co/edit/kK3NmWB9wfOopG7m5MYv?p=$p$ PVIEW

$scope.myClick 

不会从中得到其他应用程序中调用。

does not get called from within this other application.

我已经确定,具体情况取决于角应用放置在index.html文件,这会影响角点击键preSS,也许其他活动。如果我把在HTML应用程序之前,其他任何code,这开始工作。

I have determined that depending on where the Angular app is placed in the index.html file, this affects Angular click and keypress, and probably other events. If I place the app in the HTML before any of the other code, this starts working.

TL;博士
或者对如何从现有的无棱角的应用程序隔离开角code什么想法?

tl;dr Or any ideas on how to isolate Angular code from an existing non-Angular application?

感谢

推荐答案

希望这有助于人谁也有类似的问题 -

Hope this helps anyone who has a similar problem -

原来,这code是什么影响了角事件:

Turns out, this code was what was affecting the angular events:

 <!--ko if: someContext.ready() === true-->
     <div class="ls-rapidReports">
     <div ng-app="myApp">
        <div id="rapidreportCtrl" ng-controller="rrController">
            <button type="button" ng-click="myClick()">hehe</button>
        </div>

    </div>
  </div>
<!--/ko-->

所以包装角组件内部淘汰赛是坏的。

So wrapping Angular components inside Knockout is BAD.

这篇关于角事件,NG-点击,不与其他图书馆道场,淘汰赛,KendoUI,ESRI JSAPI工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆