javascript - Call a function in emblem conditional statement -
how can call function parameters in emblem's conditional statement. have function:
priorexist: (prior) -> @get("priors").findby("condition", prior)
but error when call in emblem this
if priorexist(name)
is there way call above function in emblem?
above functionality can achieved using ember components this
component if-existing-prior-component.coffee/js
app.ifexistingpriorcomponent = ember.component.extend(existingprior: (-> @get("param2").findby("condition", @get("param1")) ).property("param1"))
if-existing-prior template
if existingprior = yield
then can use above component comparisons in our emblem this:
if-existing-prior param1=name param2=priors
where priors = @get("priors")
Comments
Post a Comment