javascript - How to make HTML display a default string that is later replaced by a string taken from angular brackets? -
so @ moment in handlebar file there this:
<p>colour selected: {{selectedtype.colour}}</p>
... selectedtype object .js file looks like:
selectedtype: [{clothing: 'shirt', size: 'big', colour: 'blue'}, {clothing: 'socks', size: 'small', colour: 'red'}],
this part of ember-power-select box allows, example, website display colour selected: blue underneath when select shirt.
this when nothing has been selected yet, webpage displays colour selected: without given. want change default blue shown until has been selected.
in controller, can check if selectedtype.colour undefined or null. assign default value if undefined or null.
Comments
Post a Comment