diff --git a/src/content_script_include.js b/src/content_script_include.js index 272f544..16b985a 100644 --- a/src/content_script_include.js +++ b/src/content_script_include.js @@ -5,8 +5,6 @@ var existingWindowDotAngular = window['angular']; // angular.js to load itself into var angular = (window.angular = {}); -injectScripts(); - function injectScripts () { loadScript('vendor/jquery/dist/jquery.js', loadAngular); diff --git a/src/content_script_web.js b/src/content_script_web.js index 6e119ce..d009f53 100644 --- a/src/content_script_web.js +++ b/src/content_script_web.js @@ -2,3 +2,9 @@ @@include('content_script_include.js') +injectScripts(); //found in the included file + +// will be called within a angular service +function storeTagData (tagData) { + console.log('storeTagDataInBrowser was called'); +} \ No newline at end of file diff --git a/src/menu/menu.controller.ts b/src/menu/menu.controller.ts index e4c9eda..c9bd0cc 100644 --- a/src/menu/menu.controller.ts +++ b/src/menu/menu.controller.ts @@ -35,6 +35,7 @@ module tagIt { onTagSelect (sense: ISense) { this.selectedWordService.addTagToPage(sense); + this.dataService.storeTagingInformation({}); } onWordSelected = (newWord : string) => { diff --git a/src/services/data.service.ts b/src/services/data.service.ts index 6b889f7..eb2f6a0 100644 --- a/src/services/data.service.ts +++ b/src/services/data.service.ts @@ -4,6 +4,10 @@ module tagIt { + //Declare that function is available. + //The actual function is found in the content_script + declare function storeTagData() : void; + export class DataService { $http : ng.IHttpService; @@ -27,8 +31,8 @@ module tagIt { // save tagging information // Params: email, tagging, sentence - storeTaggingInformation (tag : Object) { - + storeTagingInformation (tag : Object) { + storeTagData(); } private createQuery (word: string) {