1

I have the following Ember template;

{{#with model}}
<h2>Order #{{id}}</h2>
<table>
    <thead>
        <tr>
            <th>Outlet</th>
            <th>Date</th>
            <th>Link</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>{{outlet}}</td>
            <td>{{date}}</td>
            <td>{{#link-to 'next-route' this}}Go{{/link-to}}</td>
        </tr>
    </tbody>
</table>
{{/with}}
<hr>
{{outlet}}

How to do I keep Ember from using the first {{outlet}} (which is just the property's name) to add the next view I'm transitioning to?

1 Answer 1

2

outlet is a reserved word, that being said, if you fully qualify it it will work.

In your case, with the with block you can't fully qualify it, but if you remove the with block it will work.

Personally I'd avoid using it, it's analogous to having a variable named for or if

<h2>Order #{{id}}</h2>
<table>
    <thead>
        <tr>
            <th>Outlet</th>
            <th>Date</th>
            <th>Link</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>{{model.outlet}}</td>
            <td>{{date}}</td>
            <td>{{#link-to 'next-route' this}}Go{{/link-to}}</td>
        </tr>
    </tbody>
</table>
<hr>
{{outlet}}
Sign up to request clarification or add additional context in comments.

1 Comment

To keep the model. bit from repeating, I was using #with. But I guess it's one thing or the other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.