Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

directive multiple input

// Add properties into the Directive class with @Input() decorator

@Directive({
    selector: '[selectable]'
})
export class SelectableDirective{
    private el: HTMLElement;

    @Input('selectable') option:any;   
    @Input('first') f;
    @Input('second') s;

    ...
}


//And in the template pass bound properties to your li element

<li *ngFor = 'let opt of currentQuestion.options' 
    [selectable] = 'opt' 
    [first]='YourParameterHere'
    [second]='YourParameterHere'
    (selectedOption) = 'onOptionSelection($event)'>
    {{opt.option}}
</li>
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript array join last element with and 
Javascript :: next js get query parameters 
Javascript :: java script example 
Javascript :: get query params from url 
Javascript :: react onchange url 
Javascript :: javascript for each 
Javascript :: Angular patchValue dynamically 
Javascript :: Warning: Internal React error: Expected static flag was missing. Please notify the React team. 
Javascript :: lodash sum 
Javascript :: ternary operator nodejs 
Javascript :: angular indexeddb 
Javascript :: puppeteer stealth popup 
Javascript :: Return an html element with react 
Javascript :: jquery numeric validation 
Javascript :: vue-router beforeeach 
Javascript :: ajax call to load a page on scrolling 
Javascript :: trim text 
Javascript :: jquery in javascript 
Javascript :: declare int in javascript 
Javascript :: jquery properly work 
Javascript :: jquery send to another page 
Javascript :: connectedcallback web components 
Javascript :: Iterate with JavaScript Do...While Loops 
Javascript :: change value on selected jquery 
Javascript :: react native radio buttons 
Javascript :: react select 
Javascript :: javascript create string of given length 
Javascript :: Working of JavaScript Arrays 
Javascript :: sequelize transaction 
Javascript :: js Arrays indexOf 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =