angular service calls content_script

This commit is contained in:
Nils Norman Haukås 2015-10-24 16:05:22 +02:00
parent 3caa37847a
commit 68dfc3c487
4 changed files with 13 additions and 4 deletions

View file

@ -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);

View file

@ -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');
}

View file

@ -35,6 +35,7 @@ module tagIt {
onTagSelect (sense: ISense) {
this.selectedWordService.addTagToPage(sense);
this.dataService.storeTagingInformation({});
}
onWordSelected = (newWord : string) => {

View file

@ -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) {