Reuse Angular 2 service in Chrome extension -


i have angular 2 app talks webserver via angular service (by angular service mean client side code talks webserver, in angular lingo called 'service'. example)

i build chrome extension integrates address bar (chrome.omnibox.oninputentered.addlistener) , reuses service angular app chrome ext use same code talk server side service angular app.
angular service written in typescript , uses angular's http module , rxjs.

is common so? what's best practices refactoring service such it's usable in both targets?


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -