jhonnymichel / Xexeu-View

A view library built for learning purposes. implements the Observer design pattern.
4 stars 2 forks source link

Implement access via bracket[] for object keys in template #2

Open jhonnymichel opened 6 years ago

jhonnymichel commented 6 years ago

Right now it is not possible to bind to objects using bracket notation. that means we cannot access keys via other properties' values.

I.E.: if our viewModel look like this:

$viewModel: {
  selected: 2,
  items: ['orange', 'apple', 'grapes']
}

we cannot do this in the template:

<p xexeu-bind="items[selected]"></p>

jhonnymichel commented 6 years ago

Something else related to this issue: directives should receive a list of hooks since it can be dependant of one or more property