windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server https://softhier.com/ instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

Using conditional statement in bind-attr Handlebars Ember.js

Asked By: Anonymous

How can I use a conditional statement inside my Handlebars template with limited results. I can get it to work fine if there is only one button that is clicking because it is static then but when I test against two buttons no dice –

<a {{bind-attr class="isClicked:clicked"}} {{action 'raiseValue'}}><i class="fa fa-caret-up"></i></a>
<a {{bind-attr class="isClicked:clicked"}} {{action 'lowerValue'}}><i class="fa fa-caret-down"></i></a>

And in my controller –

selected: '', 
isClicked: function (sender) {
    return this.get('selected') === sender;
}.property('selected'),
actions: {
    raiseValue: function() { this.set('selected', 'raise'); }
}

What I would expect to happen

When the value of clicked changes it would pass that in to my anon function and return whether the value of clicked === the clicked value of the object passed in.

What does happen

sender === ‘isClicked’ in that scenario

I have tried using a conditional statement in the binding but that isn’t working at all –

<a {{bind-attr class="(isClicked === 'raise'):clicked"}} {{action 'raiseValue'}}><i class="fa fa-caret-up"></i></a>

Basically I am trying to mimic how a radio button works I guess… Any thoughts as to what is going wrong here?


Solution

Answered By: Anonymous

You cannot pass in parameters into a computed property like that. The simples solution is to split it like this:

isRaiseClicked: function () {
    return this.get('selected') === "raise";
}.property('selected'),

isLowerClicked: function () {
    return this.get('selected') === "lower";
}.property('selected'),

<a {{bind-attr class="isRaiseClicked:clicked"}} {{action 'raiseValue'}}><i class="fa fa-caret-up"></i></a>
<a {{bind-attr class="isLowerClicked:clicked"}} {{action 'lowerValue'}}><i class="fa fa-caret-down"></i></a>

techinplanet staff

instagram volgers kopen volgers kopen buy windows 10 pro buy windows 11 pro


Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno
Alanya escort Manavgat escort Fethiye escort Kemer escort Didim escort Çanakkale escort Aydın escort Muğla escort Tekirdağ escort Manisa escort Balıkesir escort Trabzon escort Elazığ escort Ordu escort Kütahya escort Isparta escort Rize escort Kahramanmaraş escort Yalova escort Giresun escort Yozgat escort Tokat escort Şanlıurfa escort Sivas escort Batman escort Erzurum escort Sinop escort Kırşehir escort Karaman escort Kırıkkale escort Bolu escort Amasya escort Niğde escort Uşak escort Edirne escort Çorum escort Osmaniye escort Zonguldak escort Van escort Erzincan escort Söke escort Bodrum escort Çerkezköy escort Akhisar escort Bandırma escort Ayvacık escort Akçaabat escort Karakoçan escort Altınordu escort Tavşanlı escort Eğirdir escort Ardeşen escort Afşin escort Altınova escort Bulancak escort Sorgun escort Erbaa escort Viranşehir escort Zara escort Kozluk escort Aziziye escort Ayancık escort Kaman escort Ermenek escort Keskin escort Gerede escort Göynücek escort Bor escort Banaz escort Havsa escort Osmancık escort Bahçe escort Alaplı escort Başkale escort Kemah escort Nazilli escort Fethiye escort Çorlu escort Alaşehir escort Altıeylül escort Biga escort Araklı escort Kovancılar escort Fatsa escort Simav escort Yalvaç escort Çayeli escort Dulkadiroğlu escort Çiftlikköy escort Espiye escort Sarıkaya escort Niksar escort Suruç escort Yıldızeli escort Sason escort Horasan escort Boyabat escort Mucur escort Sarıveliler escort Yahşihan escort Göynük escort Gümüşhacıköy escort Çamardı escort Eşme escort İpsala escort Sungurlu escort Hasanbeyli escort Çaycuma escort İpekyolu escort Refahiye escort Kuşadası escort Marmaris escort Süleymanpaşa escort Turgutlu escort Susurluk escort Gelibolu escort Of escort Ünye escort Domaniç escort Fındıklı escort Elbistan escort Çınarcık escort Tirebolu escort Akdağmadeni escort Turhal escort Eyyübiye escort Suşehri escort Yakutiye escort Gerze escort Mengen escort Merzifon escort Ulukışla escort Sivaslı escort Keşan escort Kadirli escort Ereğli escort Özalp escort Tercan escort Efeler escort Didim escort Çine escort Dalaman escort Menteşe escort Milas escort Ortaca escort Seydikemer escort Ergene escort Kapaklı escort Malkara escort Salihli escort Şehzadeler escort Soma escort Yunusemre escort Ayvalık escort Bigadiç escort Burhaniye escort Gönen escort Karesi escort Çan escort Yenice escort Ortahisar escort Yomra escort Perşembe escort Pazar escort Onikişubat escort Pazarcık escort Türkoğlu escort Eynesil escort Görele escort Piraziz escort Yağlıdere escort Çayıralan escort Boğazlıyan escort Zile escort Siverek escort Karaköprü escort Haliliye escort Akçakale escort Şarkışla escort Gemerek escort Oltu escort Palandöken escort Mudurnu escort Suluova escort Taşova escort Toprakkale escort Kilimli escort Tuşba escort Üzümlü escort http://www.kadinescort.net Gaziantep escort Denizli escort Adana escort Hatay escort Aydın escort İzmir escort Ankara escort Antalya escort Bursa escort İstanbul escort Kocaeli escort Konya escort Muğla escort Malatya escort Kayseri escort Mersin escort Samsun escort Sinop escort Tekirdağ escort Eskişehir escort Yalova escort Rize escort Amasya escort Balıkesir escort Çanakkale escort Bolu escort Erzincan escort Şırnak escort Van escort Yozgat escort Zonguldak escort Afyon escort Adıyaman escort Bilecik escort Aksaray escort Ağri escort Bitlis escort Siirt escort Çorum escort Burdur escort Diyarbakir escort Edirne escort Düzce escort Erzurum escort Kırklareli escort Giresun escort Kilis escort Kars escort Karabük escort Kırıkkale escort Mardin escort Kırşehir escort Maraş escort Manisa escort Muş escort Kastamonu escort Ordu escort Nevşehir escort Sakarya escort Osmaniye escort Şanliurfa escort Sivas escort Trabzon escort Tokat escort Ardahan escort Bartın escort Karaman escort Batman escort Bayburt escort Bingöl escort Elaziğ escort Gümüşhane escort Hakkari escort Isparta escort Uşak escort Igdır escort bursa escort bursa escort istanbul escort denizli escort düzce escort malatya escort erzincan escort zonguldak escort eskişehir escort gaziantep escort gaziantep escort gümüşhane escort hatay escort hatay escort ığdır escort gaziantep escort istanbul escort konya escort izmit escort kars escort escort adana escort bayan adıyaman escort bayan afyon escort bayan ağrı escort bayan aksaray escort bayan amasya escort bayan antalya escort bayan ankara escort bayan ardahan escort bayan artvin escort bayan aydın escort bayan balıkesir escort bayan bartın escort bayan batman escort bayan bayburt escort bayan bilecik escort bayan bingöl escort bayan bitlis escort bayan bolu escort bayan burdur escort bayan bursa escort bayan Çanakkale escort bayan Çankırı escort bayan Çorum escort bayan denizli escort bayan diyarbakır escort bayan düzce escort bayan edirne escort bayan elazığ escort bayan sivas escort bayan sinop escort bayan urfa escort samsun escort bayan sakarya escort bayan rize escort bayan osmaniye escort bayan ordu escort bayan niğde escort bayan nevşehir escort bayan muş escort bayan muğla escort bayan mersin escort bayan mardin escort bayan manisa escort bayan malatya escort bayan kütahya escort bayan konya escort bayan kocaeli escort bayan kırşehir escort bayan kırklareli escort bayan kırıkkale escort bayan kilis escort bayan kıbrıs escort bayan kayseri escort bayan kastamonu escort bayan kars escort bayan karaman escort bayan karabük escort bayan maraş escort izmit escort bayan izmir escort bayan istanbul escort bayan Isparta escort bayan Iğdır escort bayan hatay escort bayan hakkari escort bayan gümüşhane escort bayan giresun escort bayan gaziantep escort bayan eskişehir escort bayan erzurum escort bayan erzincan escort bayan tekirdağ escort bayan tokat escort bayan trabzon escort bayan uşak escort bayan van escort bayan yalova escort bayan yozgat escort bayan zonguldak escort bayan