{"action":"opened","issue":{"url":"https://api.github.com/repos/sunyue1992/project_2015/issues/1","labels_url":"https://api.github.com/repos/sunyue1992/project_2015/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/sunyue1992/project_2015/issues/1/comments","events_url":"https://api.github.com/repos/sunyue1992/project_2015/issues/1/events","html_url":"https://github.com/sunyue1992/project_2015/issues/1","id":129135898,"number":1,"title":"eval和parse的区别","user":{"login":"sunyue1992","id":9960131,"avatar_url":"https://avatars.githubusercontent.com/u/9960131?v=3","gravatar_id":"","url":"https://api.github.com/users/sunyue1992","html_url":"https://github.com/sunyue1992","followers_url":"https://api.github.com/users/sunyue1992/followers","following_url":"https://api.github.com/users/sunyue1992/following{/other_user}","gists_url":"https://api.github.com/users/sunyue1992/gists{/gist_id}","starred_url":"https://api.github.com/users/sunyue1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunyue1992/subscriptions","organizations_url":"https://api.github.com/users/sunyue1992/orgs","repos_url":"https://api.github.com/users/sunyue1992/repos","events_url":"https://api.github.com/users/sunyue1992/events{/privacy}","received_events_url":"https://api.github.com/users/sunyue1992/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-27T13:01:56Z","updated_at":"2016-01-27T13:01:56Z","closed_at":null,"body":"$eval是scope上的一个方法，会在当前的scope上执行一个Angular的expression，并且返回结果\r\n$parse是Angular的一个服务，能够将一个expression编译成一个函数返回\r\n（2）$parsers, $setValidity \r\nlink: function(scope, element, attrs, ctrl) {\r\nctrl.$parsers.push(function(value) {\r\nvar regex = /[A-Z]\\d[A-Z]\\s?\\d[A-Z]\\d/;\r\nvar success = regex.test(value); \r\nctrl.$setValidity('postal', success); return value; \r\n}); \r\n};\r\n（3） $compile\r\n$compile(templateString)(scope) will compile plain templateString and link it with `scope`."}}