{"action":"created","issue":{"url":"https://api.github.com/repos/ecomfe/er/issues/160","labels_url":"https://api.github.com/repos/ecomfe/er/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/ecomfe/er/issues/160/comments","events_url":"https://api.github.com/repos/ecomfe/er/issues/160/events","html_url":"https://github.com/ecomfe/er/issues/160","id":71627235,"number":160,"title":"ER的两点疑问","user":{"login":"Phinome","id":1940194,"avatar_url":"https://avatars.githubusercontent.com/u/1940194?v=3","gravatar_id":"","url":"https://api.github.com/users/Phinome","html_url":"https://github.com/Phinome","followers_url":"https://api.github.com/users/Phinome/followers","following_url":"https://api.github.com/users/Phinome/following{/other_user}","gists_url":"https://api.github.com/users/Phinome/gists{/gist_id}","starred_url":"https://api.github.com/users/Phinome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phinome/subscriptions","organizations_url":"https://api.github.com/users/Phinome/orgs","repos_url":"https://api.github.com/users/Phinome/repos","events_url":"https://api.github.com/users/Phinome/events{/privacy}","received_events_url":"https://api.github.com/users/Phinome/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-28T15:50:20Z","updated_at":"2015-04-29T03:02:31Z","closed_at":null,"body":"我按照 ER DEMO 中的 book-store 例子，写了一个类似的例子，有一些疑问，\r\n\r\n第一个是关于ER中Action,Model,View 实例创建方式的疑问：例如：\r\n```\r\n// 在 ER 中声明一个 Action\r\n...\r\nvar Action = require('er/Action');\r\nfunction indexAction() {\r\n    Action.apply(this, arguments);\r\n}\r\nindexAction.prototype.modeType = require('index/indexModel');\r\nindexAction.prototype.viewType   = require('index/indexView');\r\n.............\r\nrequire('er/util').inherits(indexAction, Action);\r\n```\r\n\r\n用上面的代码创建 Action 时，有两点：\r\n\r\n1. modeType , viewType 能否默认为 indexModel, indexView ？这一点，想请教一下你们的考虑；\r\n2. 是否有这样一种方式生成 Action：\r\n````\r\ndefine([\r\n    'er'\r\n], function(er) {\r\n    var indexAction = er.Action.extend({\r\n        modeType:  require('index/indexModel'),\r\n        viewType :  require('index/indexView'),\r\n        initBehavior: function() {\r\n            console.log(this);\r\n        }\r\n    ....\r\n    });\r\n    \r\n    return indexAction;\r\n});\r\n```\r\n\r\n第二，想问问 ER 与 ESUI 结合使用的例子，我看之前的 errorrik 写的 ER 中有一个 ui.js 中写了个 ui  adapter ，将 ER 与 ESUI 结合了起来，那么，新版的 ER 可否采用相同的方式或者你们在实践中又是怎样处理的呢？\r\n\r\n以上两个问题，感谢！"},"comment":{"url":"https://api.github.com/repos/ecomfe/er/issues/comments/97290497","html_url":"https://github.com/ecomfe/er/issues/160#issuecomment-97290497","issue_url":"https://api.github.com/repos/ecomfe/er/issues/160","id":97290497,"user":{"login":"Phinome","id":1940194,"avatar_url":"https://avatars.githubusercontent.com/u/1940194?v=3","gravatar_id":"","url":"https://api.github.com/users/Phinome","html_url":"https://github.com/Phinome","followers_url":"https://api.github.com/users/Phinome/followers","following_url":"https://api.github.com/users/Phinome/following{/other_user}","gists_url":"https://api.github.com/users/Phinome/gists{/gist_id}","starred_url":"https://api.github.com/users/Phinome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Phinome/subscriptions","organizations_url":"https://api.github.com/users/Phinome/orgs","repos_url":"https://api.github.com/users/Phinome/repos","events_url":"https://api.github.com/users/Phinome/events{/privacy}","received_events_url":"https://api.github.com/users/Phinome/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T03:02:31Z","updated_at":"2015-04-29T03:02:31Z","body":"感谢@otakustay ，我明白你的意思了，我先研究研究，有问题再请教。"}}