From 8aea12e76a6e6a99645cccc90db56281c07e5d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Norman=20Hauk=C3=A5s?= Date: Sun, 24 Jan 2016 15:30:08 +0100 Subject: [PATCH] Move angular declaration inside init method to avoid calling angular before its ready --- src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index c3113f7..3c10495 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,15 +8,16 @@ module tagIt { - angular.module('tagit', ['ngStorage']) + export function init(callback: () => void) { + + angular.module('tagit', ['ngStorage']) .config(AppConfigInitializer) .service('AppConfigService', AppConfigService) .service('BackendService', BackendService) .service('WebPageService', WebPageService) .service('TagStorageService', TagStorageService) .controller('MenuCtrl', MenuCtrl); - - export function init(callback: () => void) { + var iframe = document.getElementById("tagit-iframe") angular.bootstrap(iframe.contentDocument.getElementById("tagit-menu"), ['tagit']); console.log('TagIt menu loaded');