typescript - Importing vss-web-extension-sdk modules in Angular-CLI components -
i'm trying create vsts/tfs extension based on angular/cli app. i've created new app using ng new , compiles , serves fine. now, problem referencing , consuming vss sdk in components.
i've made changes based on recommendations made here:
added "vss-web-extension-sdk" package.json dependencies:
"dependencies": { "@angular/animations": "^4.0.0", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "core-js": "^2.4.1", "rxjs": "^5.1.0", "vss-web-extension-sdk": "^2.117.0", "zone.js": "^0.8.4" },
added following typings.json file:
{ "globaldependencies": { "jquery": "registry:dt/jquery#1.10.0+20160929162922", "knockout": "registry:dt/knockout#0.0.0+20160914182733", "q": "registry:dt/q#0.0.0+20161004185634", "require": "registry:dt/require#2.1.20+20160919185614", "tfs": "npm:vss-web-extension-sdk/typings/tfs.d.ts", "vss": "npm:vss-web-extension-sdk/typings/vss.d.ts" } }
imported "vss/context"
import * vss_context 'vss/context';
at point app builds no errors, when try consume imported module, build error: module not found: error: can't resolve 'vss/context'
this how consume imported module:
export class appcomponent { title = 'app'; constructor() { var ctx = vss_context.getdefaultwebcontext(); } }
the entire app can found @ https://github.com/shaycy/tfs-ng-app
Comments
Post a Comment