Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Bubble up variable from helper

$
0
0

@frsechet wrote:

Hi,
I'm creating a helper that replaces part of a string with an input.
Something like this:

lorem ipsum %s test => lorem ipsum _______ test

Then I would like to use that input's value in other places in the same component.

Here is my helper:

import Ember from 'ember';

export function replaceInput(params) {
  let phrase = params[0].replace("%s", "<input type='text' value='xxxxxx'/>");
  return new Ember.String.htmlSafe(phrase);
}

export default Ember.Helper.helper(replaceInput);

What I need is to be able to type something into the input and retrieve that value as I go.
How would I best go about that?
Thanks for your help!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles