Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9154089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:22:30+00:00 2026-06-17T12:22:30+00:00

I have http://jsfiddle.net/pF2cF/6/ code with 2 problems: 1. click MyButton doesn’t go to clickButton

  • 0

I have http://jsfiddle.net/pF2cF/6/ code with 2 problems:
1. click “MyButton” doesn’t go to clickButton function in App.indexController
2. enter in the text field will trigger MyButton click first (if #1 get solved)

Can anyone help to solve them? I do have a workaround for by using , but I’m not sure what’s wrong with using.

Thanks!

The code snippets are as following, using ember.js from its master branch on 01/14/2013:

    <script type="text/x-handlebars" data-template-name="myTemplate">
        <button {{action clickButton target="App.indexController"}} >MyButton1</button>
        {{view App.MyView placeholder="Input something 1 and enter"}}
    </script>

App = Em.Application.create({
  ready: function () {
  }
});

App.Router.map(function () {
  this.route("index", { path: "/" });  //master 01142013 syntax
});
App.IndexRoute = Ember.Route.extend({
  renderTemplate: function () {
    this.render('myTemplate', {controller: 'indexController'});
  }
});

App.indexController = Ember.Controller.extend({
  clickButton: function () {
    alert("clickButton");
  }
});

App.MyView = Em.TextField.extend({
  insertNewline: function (evt) {
    alert("enter pressed");
  }
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:22:31+00:00Added an answer on June 17, 2026 at 12:22 pm

    You made a number of small errors. I have put a working version on JSBin.

    Stylistic issues that did not cause any failures:

    • You don’t need to declare any index routes.
    • You don’t need an empty ready method on Application. In general, put startup logic in ApplicationRoute#setupController, where you will also have access to controllers.
    • You should name your template the same name as the route unless you are trying to share a single template across multiple routes. In this case, you should have just used index rather than myTemplate.

    Issues related to the failures:

    • Controller names should be capitalized: App.IndexController not App.indexController
    • You shouldn’t specify a target if the target is the current controller.
    • Your render call specifies { controller: 'indexController' }. It should be { controller: 'index' }.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: http://jsfiddle.net/5RbrL/ As you can see, the text doesn't go over
I have this code : http://jsfiddle.net/VAkLn/6/ When i add a table : http://jsfiddle.net/VAkLn/7/ this
Take the example I have setup at http://jsfiddle.net/vEF6y/ Click on the 'add item' button
I have this fiddle: http://jsfiddle.net/9J5Fg/ When one box is open and I click on
Here is the code I have: http://jsfiddle.net/Draven/rEPXM/23/ I'd like to know how I can
I have this code : http://jsfiddle.net/Qchmqs/BSKrG/ <div class=step><-- this is darned wrong <div id=step2><a>Darn</a></div>
Here is a very simple example of what I have: http://jsfiddle.net/MxKLU/ Click on the
Good Day all, i have been working with http://jsfiddle.net , the sample app i
I have this: http://jsfiddle.net/bnNSW/ I want a functional navigation menu. How? On click background
I have: http://jsfiddle.net/Gkz4v/9/ .pagination li a { float: left; width: 6px; height: 6px; line-height:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.