0
votes

Is what I am trying to do in this gist possible?

https://gist.run/?id=bea803b05ad8d5b5e3e0afd59bb8dbb1

In app.html, I'm trying to use a repeat.for to create a custom element called button-row

In app.js, I'm creating two button row instances which I then place into a button row array so that I can use the repeat.for to iterate over it and create the button rows on the app.html view.

In button-row.html, I have a repeat.for to create the buttons using the btns array and setting the name of the button.

In button-row.js, I have two properties. label is the label for the button row and btns is the array of all the button names I want to create.

Sorry if this is a noob question, I have only been working with web development and aurelia for about a month.

1

1 Answers

2
votes

Instantiating the ButtonRow objects yourself won't work. Aurelia instantiates the instances. you'll need to use the binding system to pass in the information to the custom element. I updated your gist here: https://gist.run/?id=6ec71143f566571960b7a182d4d98ed4

Also, you should refrain from abbreviating words like "Button" let your tooling save you the keystrokes, while making your code more readable :-)