Include initial angularjs files

This commit is contained in:
Kyle Johnson 2014-11-15 19:34:00 +00:00
parent b04d970132
commit 4c0e2dc743
3 changed files with 22 additions and 1 deletions

View File

@ -37,7 +37,7 @@ function xhtmlHeaders( $file, $title )
extract( $GLOBALS, EXTR_OVERWRITE );
?>
<!DOCTYPE html>
<html lang="en">
<html lang="en" ng-app="ZoneMinder">
<head>
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= validHtmlStr($title) ?></title>
<meta charset="utf-8">
@ -69,6 +69,9 @@ function xhtmlHeaders( $file, $title )
<?php
}
?>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="<?= getSkinFile('js/app.js'); ?>"></script>
<script src="<?= getSkinFile('js/controllers.js'); ?>"></script>
<script type="text/javascript" src="<?= $bootstrapJsFile ?>"></script>
<script type="text/javascript" src="tools/mootools/mootools-core.js"></script>
<script type="text/javascript" src="tools/mootools/mootools-more.js"></script>

View File

@ -0,0 +1,11 @@
var ZoneMinder = angular.module('ZoneMinder', [
'ZoneMinderControllers'
]);
ZoneMinder.factory('Header', function($http) {
return {
getLogState: function(callback) {
$http.get('/api/monitors.json').success(callback);
}
};
});

View File

@ -0,0 +1,7 @@
var ZoneMinder = angular.module('ZoneMinderControllers', [])
.controller('HeaderController', function($scope, Header) {
Header.getLogState(function(results) {
console.log(results);
});
});