ember.js - How to get data back from emberjs controller -
I have a list of routes
App.Router.map () - & Gt; About '@source' '@Source' User ', - & gt; @source 'repositories', path: '/: user_name / repositories' @route 'show', path: '/: user_name' shows a template in my users I also have a view
{{# view.Repositories View Login = Login}} & lt; Div class = "show_repos_control" & gt; & Lt; Span & gt; Show Rape & lt; / Span & gt; & Lt; / Div & gt; {{#if reposWasQuery}} {{repo_name}} {{/ each}} {{/ if}} {{/ view}} class with view < Pre> app. See Repositories = Amber View. Expansion ({click: function (evt) {this.get ('controller'). Send ('showRepos', this.get ('login'));}}); Code code in UsersShowController
See class code processing in App.UsersShowController = Ember.ObjectController.extend ({reposWasQuery: incorrect, verbs: {showRepos: Function (user name) {this.set ('reposWasQuery', true); this.set ('repositories', jQuery.getJSON ('/ users /' + userName + '/ repositories'));}}}) The repository data is excellently assigned, but in my opinion I can not cancel it. Getting "#error some numbers" error
See this a For the route with a controller and an open closed block. Using instead of {{rangers' myRepositoriesArray}} will do the following: -
myRepositoriesArray < Submit a new repository controller with / code>. - Make a
look at the repository . Li> You will need to enter this code:
& lt; Div class = "show_repos_control" & gt; & Lt; Span & gt; Show Rape & lt; / Span & gt; & Lt; / Div & gt; {{#if reposWasQuery}} {{repo_name}} {{each}} {{/ if}} in the repository template. Amber is built with configuration in mind of the configuration. You should read on the render assistant, and provide you with a route, or the things you need to make for Amber.
Comments
Post a Comment