I am writing an AngularJS App for a system based on jQuery. Each app needs to be initiated with the code below.
How do I get this to work with my AngularJS code?
I have tried to include my entire Angular app within the function appStart(), but that doesn't work. Any ideas on how to solve this?
Init JS:
(function () {
function appStart() {
}
function genericError() {
console.error('Something went wrong');
}
TT.native.init()
.done(appStart)
.fail(genericError);
})();
My AngularJS app:
var app = angular.module('myApp', ['ui.sortable', 'ui.router']);
app.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/specs');
$stateProvider
.state('specs', {
url: '/specs',
templateUrl: 'specs.html',
controller: 'SpecsController'
})
.state('editSp...
Long time since I used it but this should work. It's a manual bootstrap of Angular so no ng-app in your index file.
(function () {
$(document).ready(function () {
if (TT) {
TT.native.init().done(function () {
angular.bootstrap(document, ['myTickTailApp']);
}).fail(function () {
// Error handling if TickTail fails to init ...
});
} else {
throw new Error('Cannot start app, tt.js not loaded');
}
});
})();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments