Angular syntax not working properly

Asked

Viewed 46 times

0

I have a page html containing the following code:

<button 
  class="button button-assertive button-full button-outline centro icon ion-plus"
  option-getter="getOpt(option, complemento)" 
  modal-select="" 
  modal-title="{{complemento.nome}}"
  ng-model="produto.adicionais[complemento.nome]" 
  options="complemento.complementos"
  option-property="nome" 
  multiple="{{ isMultiple(complemento) }}"
  has-search="true">

But in this part I call a function that returns true or false:

multiple="{{ isMultiple(complemento) }}"

It is not working, the function is not called, the HTML end gets the same code as a string.

I have tried to use without quotation marks as follows:

multiple={{ isMultiple(complemento) }}

Returning "true" or "false" of function happening the same thing.

  • Well, that multiple must be part of the lib/directive it is using. What is its/its name? Or it was you who created it?

  • It is the Ionic-modal-select. (https://github.com/inmagik/ionic-modal-select)

  • Try not to use the {{ ... }}. Ex: multiple="isMultiple(complemento)"

  • It doesn’t work, it’s been tested. It recognizes everything as true

  • Yes, if you see in the documentation any past value is accepted as true, then try to return null instead of false.

  • But the problem is just this. The function is not called, it goes as string pro html. Any value I return will not appear there, and the console.log inside the function also does not appear on the console.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.