{"action":"opened","issue":{"url":"https://api.github.com/repos/marijnh/tern/issues/652","labels_url":"https://api.github.com/repos/marijnh/tern/issues/652/labels{/name}","comments_url":"https://api.github.com/repos/marijnh/tern/issues/652/comments","events_url":"https://api.github.com/repos/marijnh/tern/issues/652/events","html_url":"https://github.com/marijnh/tern/issues/652","id":108636268,"number":652,"title":"Angular2 & TypeScript Tern Support","user":{"login":"angelozerr","id":1932211,"avatar_url":"https://avatars.githubusercontent.com/u/1932211?v=3","gravatar_id":"","url":"https://api.github.com/users/angelozerr","html_url":"https://github.com/angelozerr","followers_url":"https://api.github.com/users/angelozerr/followers","following_url":"https://api.github.com/users/angelozerr/following{/other_user}","gists_url":"https://api.github.com/users/angelozerr/gists{/gist_id}","starred_url":"https://api.github.com/users/angelozerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angelozerr/subscriptions","organizations_url":"https://api.github.com/users/angelozerr/orgs","repos_url":"https://api.github.com/users/angelozerr/repos","events_url":"https://api.github.com/users/angelozerr/events{/privacy}","received_events_url":"https://api.github.com/users/angelozerr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-28T11:04:33Z","updated_at":"2015-09-28T11:04:33Z","closed_at":null,"body":"@marijnh I create this issue just to share with you my study how to support Angular2 with tern. You can close it if you wish.\r\n\r\nAngular2 uses TypeScript >= 1.5 if I have understood. Here a sample code:\r\n\r\n```javascript\r\n/// <reference path=\"typings/angular2/angular2.d.ts\" />\r\n\r\nimport {HTTP_BINDINGS} from 'angular2/http';\r\nimport {Component, View, bootstrap, bind} from 'angular2/angular2';\r\nimport {DemoPage} from './demo-page';\r\nimport {About} from './components/about/about';\r\nimport {ROUTER_BINDINGS, LocationStrategy, HashLocationStrategy} from 'angular2/router';\r\nimport {RouterLink, RouteConfig, Router, RouterOutlet, Location, RouteParams} from 'angular2/router';\r\n\r\n@Component({\r\n   selector: 'demo-app'\r\n})\r\n\r\n@View({\r\n    templateUrl: './demo-app.html',\r\n    directives:[DemoPage, RouterLink, RouterOutlet, About]\r\n})\r\n\r\n@RouteConfig([\r\n    {path: '/', component: DemoPage, as: 'home'},\r\n    {path: '/about/:id', component: About, as: 'about'}\r\n])\r\n \r\nclass MyDemoApp {\r\n\r\n    router: Router;\r\n    location: Location;\r\n\r\n    constructor(router: Router, location: Location) {\r\n        this.router = router;\r\n        this.location = location;\r\n    }\r\n\r\n    getLinkStyle(path) {\r\n        return this.location.path() === path;\r\n    }\r\n}\r\n\r\nbootstrap(MyDemoApp,[HTTP_BINDINGS,ROUTER_BINDINGS, bind(LocationStrategy).toClass(HashLocationStrategy)]);\r\n```\r\n\r\nThis sample uses the type declaration (eg: router: Router) and the decorator (if I have understood, ES7 should provide that).\r\n\r\nIf tern wishes one day to support Angular2, it needs to support:\r\n\r\n * typescript syntax with acorn (by developping a plugin acorn-ts like acorn-jsx)\r\n * supports ES7 decorator\r\n\r\nI think you will not have time to support those features that's why I'm studying TypeScript LanguageService. My idea is to study if we could have the same information than tern (for completion, definition, etc) and if it's possible my idea is to create a TernTypeScriptServer which will support the same query than tern server but the implementation will use typescript language service. In other words if I can create my idea, any tern client (Emcas, Vim, Sublime, etc) could use TernTypeScriptServer .\r\n\r\nIf someone are interested with this idea, I have created the project at https://github.com/angelozerr/tern-typescript\r\n\r\n@marijnh is it ok that I call this project tern-script? It will not use tern but will provides the same tern server API."}}