简体   繁体   English

AngularJS 在同一页面中使用相同的组件

[英]AngularJS Use Same Component In same Page

I use angularjs first time.我第一次使用 angularjs。 I'm tring to use same search component twice in page.我试图在页面中使用相同的搜索组件两次。 but in the second component modal.show is not working!但在第二个组件中 modal.show 不起作用!

Here is my code.这是我的代码。

my button click code.我的按钮点击代码。 Where i click a modal will show.我点击一个模式将显示。

$scope.openTalepIsEmriList = function (talepUN) {
                a.talepisemrilistesi = [];
                $("#divTalepIsEmriListesiModal").modal("show");
                $http({
                    method: 'POST',
                    url: '/api/CrmTalepHareket/TalepIsEmriListesi?talepUN=' + talepUN,
                    headers: { 'Content-Type': 'application/json' }
                })
                    .then(

and in the page i call the component在页面中我调用组件

first:第一的:

 <talep-ara-tum container-id="abonearama"  kullanici-id="modelTalep.Kullanici.ID" abonemodel="Aboneler" aramadanmi="true" talepler="aratalepmodel" kullaniciisletme="kullaniciisletme"></talep-ara-tum>

second:第二:

<div class="row">
<talep-ara-tum kullanici-id="modelTalep.Kullanici.ID" abonemodel="Aboneler" 
aramadanmi="false" talepmodel="AboneSahisTalepleri" kullaniciisletme="kullaniciisletme"></talep-ara-tum></div>

I think this happens because of the two components sharing the same ID, you could change one of them to the same but add a 2 or change it to hardcoded ID's first and see if that works.我认为这是因为两个组件共享相同的 ID,您可以将其中一个更改为相同的,但添加 2 或先将其更改为硬编码的 ID,看看是否有效。 I can't really read what it says, I can't read Turkish(?).我真的看不懂它说什么,我看不懂土耳其语(?)。 Didn't know you could change the language of AngularJS.不知道您可以更改 AngularJS 的语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM