我刚刚从这个 jsfiddle更新到 EmberJS 的版本。
控制器/视图:
App = Em.Application.create();
// Instantiated and wired up for you in App.initialize()
App.ApplicationController = Em.Controller.extend();
App.ApplicationView = Em.View.extend({
templateName: 'application'
});
App.NavbarController = Em.Controller.extend();
App.NavbarView = Em.View.extend({
templateName: 'navbar'
});
// Your stuff
App.HomeController = Em.Controller.extend({});
App.HomeView = Em.View.extend({
templateName: 'home'
});
App.ProfileController = Em.Controller.extend({});
App.ProfileView = Em.View.extend({
templateName: 'profile'
});
// Nested views in the profile
App.PostsController = Em.Controller.extend({});
App.PostsView = Em.View.extend({
templateName: 'posts'
});
App.PhotosController = Em.Controller.extend({});
App.PhotosView = Em.View.extend({
templateName: 'photos'
});
我一直在使用新的路由器,但出现了一些奇怪的行为,并希望更新可以解决它,不幸的是我现在收到以下警告和错误:
WARNING: Computed properties will soon be cacheable by default. To enable this in your app, set ENV.CP_DEFAULT_CACHEABLE = true. vendor.js:54720
Uncaught TypeError: Object function () { return initMixin(this, arguments); } has no method 'finishPartial' vendor.js:42905
有人知道这里可能会发生什么吗?