{"action":"created","issue":{"url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1572","repository_url":"https://api.github.com/repos/RubyLouvre/avalon","labels_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1572/labels{/name}","comments_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1572/comments","events_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1572/events","html_url":"https://github.com/RubyLouvre/avalon/issues/1572","id":164108793,"number":1572,"title":"同一个标签使用ms-if和ms-text出现cannot set property 'nodeValue' of undefined","user":{"login":"wingsblack","id":4138748,"avatar_url":"https://avatars.githubusercontent.com/u/4138748?v=3","gravatar_id":"","url":"https://api.github.com/users/wingsblack","html_url":"https://github.com/wingsblack","followers_url":"https://api.github.com/users/wingsblack/followers","following_url":"https://api.github.com/users/wingsblack/following{/other_user}","gists_url":"https://api.github.com/users/wingsblack/gists{/gist_id}","starred_url":"https://api.github.com/users/wingsblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wingsblack/subscriptions","organizations_url":"https://api.github.com/users/wingsblack/orgs","repos_url":"https://api.github.com/users/wingsblack/repos","events_url":"https://api.github.com/users/wingsblack/events{/privacy}","received_events_url":"https://api.github.com/users/wingsblack/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-06T15:47:22Z","updated_at":"2016-07-06T18:01:12Z","closed_at":"2016-07-06T18:01:12Z","body":"``` \r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\r\n    <title></title>\r\n\t<meta charset=\"utf-8\" />\r\n    <script src=\"node_modules/avalon2/dist/avalon.js\"></script>\r\n    <script type=\"text/javascript\">\r\n        var json = [\r\n    {\r\n        \"id\": 63348,\r\n        \"messageType\": \"PUBLIC_CHAT\",\r\n        \"senderId\": \"ea3af0f050a4589e0150a929e7e30149\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/05.png\",\r\n        \"senderName\": \"aaaa\",\r\n        \"senderSex\": 1,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"service\",\r\n        \"identity\": 2,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"sdfsdf\\n\",\r\n        \"sendTime\": 1467816560000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63347,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0ae0e1e05a7\\\",\\\"title\\\":\\\"国际文传电讯：北约和俄罗斯计划于7月13日在布鲁塞尔举行会议\\\"}\",\r\n        \"sendTime\": 1467816480000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63346,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0ab975105a6\\\",\\\"title\\\":\\\"【欧市汇评】数据助力美元回升，英镑宽幅震荡\\\"}\",\r\n        \"sendTime\": 1467816318000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63345,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0ab8db605a5\\\",\\\"title\\\":\\\"法巴：脱欧引发避险情绪加剧，欧银或更改QE条款\\\"}\",\r\n        \"sendTime\": 1467816316000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63344,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a88fb205a4\\\",\\\"title\\\":\\\"奥巴马：阿富汗安全部队仍不如所需要的那么强大\\\"}\",\r\n        \"sendTime\": 1467816120000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63343,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a31a3305a3\\\",\\\"title\\\":\\\"<p style = 'color:red'>英国脱欧已推倒多米诺骨牌——恐慌将从房地产开始</p>\\\"}\",\r\n        \"sendTime\": 1467815762000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63342,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a3176205a2\\\",\\\"title\\\":\\\"美国总统奥巴马：到2016年年底将在阿富汗保留8400名士兵\\\"}\",\r\n        \"sendTime\": 1467815761000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63341,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a314ba05a1\\\",\\\"title\\\":\\\"奥巴马：将放缓美国从阿富汗撤军的速度\\\"}\",\r\n        \"sendTime\": 1467815761000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63340,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a311f905a0\\\",\\\"title\\\":\\\"<p style = 'color:red'>巴克莱将美国第二季度GDP增速预期从2.7%下调至2.4%</p>\\\"}\",\r\n        \"sendTime\": 1467815760000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    },\r\n    {\r\n        \"id\": 63339,\r\n        \"messageType\": \"NEWS\",\r\n        \"senderId\": \"28adb90376334710938e62717f0da9e2\",\r\n        \"senderAvatar\": \"/images/avatar/t3/32/01.png\",\r\n        \"senderName\": \"系统\",\r\n        \"senderSex\": null,\r\n        \"senderRoleIcon\": null,\r\n        \"senderRoleCode\": \"api\",\r\n        \"identity\": null,\r\n        \"sleepWalk\": 0,\r\n        \"identityIcon\": \"/front/assets2/identity/service.png\",\r\n        \"message\": \"{\\\"id\\\":\\\"8a7ccc0355b0cb150155c0a05709059f\\\",\\\"title\\\":\\\"<p style = 'color:red'>避险升温黄金高歌猛进创新高，脱欧担忧发酵油价三连阴</p>\\\"}\",\r\n        \"sendTime\": 1467815581000,\r\n        \"gag\": null,\r\n        \"messageStatus\": null,\r\n        \"handan\": null\r\n    }\r\n        ];\r\n\r\n        var list = [];\r\n        for (var i = 0; i < json.length; i++) {\r\n            var tmp = json[i];\r\n            list.push({\r\n                id: tmp.id,\r\n                messageType: tmp.messageType,\r\n                time: tmp.sendTime + '',\r\n                message: tmp.message,\r\n                messageFrom: {\r\n                    id: tmp.senderId,\r\n                    nickName: tmp.senderName,\r\n                    avatar: tmp.senderAvatar,\r\n                    sex: tmp.senderSex,\r\n                    identityIcon: tmp.identityIcon,\r\n                    roleCode: tmp.senderRoleCode,\r\n                    validUser: false,\r\n                    identity: tmp.identity,\r\n                    sleepWalk: tmp.sleepWalk\r\n                }\r\n            })\r\n        }\r\n\r\n    </script>\r\n    <script type=\"text/javascript\">\r\n\r\n        var template= \"<div>\\r\\n  <div ms-for=\\\"el in @innerArray\\\" class=\\\"chat-message clearfix\\\">\\r\\n    <span class=\\\"dropdown chat-message-avatar\\\">\\r\\n      <img src=\\\"http://handan.hx9999.com/img/avatar/cool-male-avatars-02.png\\\" alt=\\\"user\\\"/>\\r\\n      <i class=\\\"user-vip user-vip-3\\\"></i>\\r\\n    </span>\\r\\n    <div class=\\\"chat-message-content\\\" data-luckymoneyid=\\\"\\\">\\r\\n      <div class=\\\"chat-message-meta\\\">\\r\\n        <span class=\\\"chat-message-name\\\" ms-text=\\\"el.messageFrom.nickName\\\"></span>\\r\\n        <span class=\\\"chat-message-time\\\" ms-text=\\\"el.time\\\"></span>\\r\\n      </div>\\r\\n      <div class=\\\"chat-message-context\\\">\\r\\n        <i class=\\\"chat-message-context-caret\\\"></i>\\r\\n        <div ms-if=\\\"el.messageType == 'NEWS'\\\">\\r\\n            123\\r\\n        </div>        \\r\\n        <div ms-if=\\\"el.messageType == 'PUBLIC_CHAT'\\\" ms-text=\\\"el.message\\\"></div>\\r\\n      </div>\\r\\n    </div>\\r\\n  </div>\\r\\n</div>\";\r\n\r\n\r\n        avalon.component(\"ms-messagelist\", {\r\n            template: template,\r\n            defaults: {\r\n                innerArray: []\r\n            }\r\n        });\r\n\r\n\r\n        avalon.define({\r\n            $id: \"main\",\r\n            message_list: list\r\n        })\r\n\r\n    </script>\r\n</head>\r\n<body>\r\n    <div ms-controller=\"main\">\r\n        <wbr ms-widget='{is:\"ms-messagelist\",innerArray:@message_list}' />\r\n    </div>\r\n</body>\r\n</html>\r\n ```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/RubyLouvre/avalon/issues/comments/230854576","html_url":"https://github.com/RubyLouvre/avalon/issues/1572#issuecomment-230854576","issue_url":"https://api.github.com/repos/RubyLouvre/avalon/issues/1572","id":230854576,"user":{"login":"RubyLouvre","id":190846,"avatar_url":"https://avatars.githubusercontent.com/u/190846?v=3","gravatar_id":"","url":"https://api.github.com/users/RubyLouvre","html_url":"https://github.com/RubyLouvre","followers_url":"https://api.github.com/users/RubyLouvre/followers","following_url":"https://api.github.com/users/RubyLouvre/following{/other_user}","gists_url":"https://api.github.com/users/RubyLouvre/gists{/gist_id}","starred_url":"https://api.github.com/users/RubyLouvre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RubyLouvre/subscriptions","organizations_url":"https://api.github.com/users/RubyLouvre/orgs","repos_url":"https://api.github.com/users/RubyLouvre/repos","events_url":"https://api.github.com/users/RubyLouvre/events{/privacy}","received_events_url":"https://api.github.com/users/RubyLouvre/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T18:01:12Z","updated_at":"2016-07-06T18:01:12Z","body":"```html\r\n<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\r\n        <meta charset=\"utf-8\" />\r\n        <script src=\"../dist/avalon.js\"></script>\r\n\r\n\r\n        <script type=\"text/javascript\">\r\n\r\n            avalon.define({\r\n                $id: \"main\",\r\n                list: [\r\n                    {messageType: \"PUBLIC_CHAT\", message: \"aaa\"},\r\n                    {messageType: \"XXX\", message: \"bbbb\"}\r\n                ]\r\n            })\r\n\r\n        </script>\r\n    </head>\r\n    <body ms-controller=\"main\">\r\n        <div ms-for=\"el in @list\" >\r\n\r\n            <div ms-if=\"el.messageType == 'PUBLIC_CHAT'\"\r\n                 ms-text=\"el.message\"></div>\r\n\r\n        </div>\r\n    </body>\r\n</html>\r\n```\r\n\r\n最后简化成这样。已修。更新"}}
{"actor":{"display_login":"RubyLouvre"}}