I have created a route /test
in ember, and added a model in the route as well. But i am getting the model
as undefined, and the list is not being printed.
router.js
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('test');
});
export default Router;
routes/test.js
import Route from '@ember/routing/route';
export default class TestsRoute extends Route {
model() {
return ['abc'];
}
}
test.hbs
<ul>
<li></li>
</ul>
Aucun commentaire:
Enregistrer un commentaire