{"action":"opened","issue":{"url":"https://api.github.com/repos/RubyLouvre/avalon/issues/766","labels_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/766/labels{/name}","comments_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/766/comments","events_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/766/events","html_url":"https://github.com/RubyLouvre/avalon/issues/766","id":63642819,"number":766,"title":"希望多點對生命周期的描述","user":{"login":"eason-li","id":544848,"avatar_url":"https://avatars.githubusercontent.com/u/544848?v=3","gravatar_id":"","url":"https://api.github.com/users/eason-li","html_url":"https://github.com/eason-li","followers_url":"https://api.github.com/users/eason-li/followers","following_url":"https://api.github.com/users/eason-li/following{/other_user}","gists_url":"https://api.github.com/users/eason-li/gists{/gist_id}","starred_url":"https://api.github.com/users/eason-li/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eason-li/subscriptions","organizations_url":"https://api.github.com/users/eason-li/orgs","repos_url":"https://api.github.com/users/eason-li/repos","events_url":"https://api.github.com/users/eason-li/events{/privacy}","received_events_url":"https://api.github.com/users/eason-li/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-23T06:51:04Z","updated_at":"2015-03-23T06:51:04Z","closed_at":null,"body":"以這個例子\r\ndisplay_frag對應的div會被創建和銷毀，controller current_date卻一直存在，顯示出來的日期不會改變\r\n\r\n另一個問題是有controller destroy handler嗎？\r\n如果需要做clearInterval之類的動作，這類的handler還是很需要吧\r\n\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n  <script src=\"avalon.js\"></script>\r\n</head>\r\n<body>\r\n<script>\r\n  avalon.define('root', function (vm) {\r\n    vm.display_frag = true\r\n    vm.display_toggle = function () {\r\n      vm.display_frag = !vm.display_frag\r\n    }\r\n  })\r\n\r\n  avalon.define('current_date', function (vm) {\r\n    vm.val = new Date()\r\n  })\r\n</script>\r\n<div ms-controller=\"root\">\r\n  <span ms-click=\"display_toggle\">toggle</span>\r\n  <div ms-if=\"display_frag\" ms-controller=\"current_date\">{{val}}</div>\r\n</div>\r\n</body>\r\n</html>\r\n"}}