aurelia / aurelia/templating

Apply custom-attributes from the view-model

Open
#458 5 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
113
Forks
101
PR merge metrics
No merged PRs in 30d

Description

I couldn't find any info on this topic in the docs and i'm not sure if the template engine supports this use-case today but:

I'm trying to init and apply a custom attribute from the view-model onto a referenced HTMLElement.
Does the templateEngine support this? Else I'd like this to be a feature request.

This is what I have tried so far:

``` Javascript

// create a new instance of our popover custom-attribute.
// target is our referenced HTMLElement
let validationPopover = new Popover(target);
this.templateEngine.enhance({
element: target,
bindingContext: validationPopover
});
```

Thanks
-- Mike

Contributor guide

Open the contributing guide

Research direction

Start at the templateEngine.enhance({ element: target, bindingContext: validationPopover }) example and inspect how referenced HTMLElements and custom attributes are currently handled. Determine whether the existing enhancement entry point supports this view-model flow; if not, define the feature behavior and add coverage showing that the custom attribute is applied to the target element.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.