0
votes

I have the latest version of Aurelia although I believe it had been fixed last year (https://github.com/aurelia/framework/issues/35), I am still having issues. Does anyone else have this issue?

Custom Element:

<template>
    <i class="fa fa-question fa-sm"></i>
</template>

import {customElement, bindable, inject, bindingMode} from 'aurelia-framework';

@customElement('tooltiphelper')
@bindable({name: 'title',       attribute: 'title',     defaultValue: 'Helper text',    defaultBindingMode: bindingMode.twoWay})
@inject(Element)
export class ToolTipHelper {

    constructor(element) {
        this.element = element;
    }

    bind() 
    {
        $(this.element).tooltip( { title: this.title, placement: 'right' } );
    } 
}

Place referenced:

<template>    
<div class="row">
    <div class="col-sm-12">
        <div class="form-group">
            <label class="control-label">Name</label>
            <tooltiphelper title.bind="'Do you work?'" />
            <input disabled.bind="readonly" type="text" class="form-control" value.bind="baseContent.Name">
        </div>
    </div>
</div>
</template>

HTML Generated: Where has the input gone?

enter image description here

enter image description here

1

1 Answers

0
votes

The CE needs closing off correctly.

<template>    
<div class="row">
    <div class="col-sm-12">
        <div class="form-group">
            <label class="control-label">Name</label>
            <tooltiphelper title.bind="'Do you work?'"></tooltiphelper>
            <input disabled.bind="readonly" type="text" class="form-control" value.bind="baseContent.Name">
        </div>
    </div>
</div>
</template>