I am in the process of developing a chrome application using angularjs
along with angular-ui-router
.
app.js
var bar = angular.module('bar', [
'ui.router',
])
.config(['$stateProvider', '$locationProvider',
function($stateProvider, $locationProvider) {
console.log("Everything seems to be functioning correctly.");
$stateProvider
.state('login', {
url: '/',
templateUrl: 'modules/login/templates/login.html',
controller: 'loginController'
})
}])
login.js
bar.controller('loginController',
['$scope',
function($scope){
console.log("This console log should display properly.");
}])
window.html
<!DOCTYPE html>
<html ng-app="mycurechrome">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="components/chromestrap/js/jquery-2.0.3.min.js"></script>
<script src="components/chromestrap/js/bootstrap.min.js"></script>
<script src="bower_components/angular/angular.min.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="app.js"></script>
<script src="modules/login/controllers/login.js"></script>
<link href="components/chromestrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/window.css" rel="stylesheet">
</head>
<body>
<div ui-view></div>
</body>
</html>
manifest.json
{
"name": "bar",
"description": "foo",
"version": "0.1",
"manifest_version": 2,
"app": {
"background": {
"scripts": [
"background.js"
]
}
},
"icons": { "16": "icon-16.png", "128": "icon-128.png" }
}
background.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('window.html', {
'outerBounds': {
'width': 1000,
'height': 600
}
});
});
In the app.js
, the line
console.log("Everything seems to be functioning correctly.");
is executed as expected, however, the logging statement in login.js
does not appear.
I believe I am implementing ui-router
correctly, but I have some doubts because there might be a different technique for creating google chrome applications.