Please be gentle since I'm fairly new to angular being used with node-red. I'm taking a working example if I just server it on another web server but I'm not sure why I'm having this problem. Any help is greatly appreciated.
I've got the following HTML:
<!DOCTYPE html>
<html ng-app=app>
<head>
<title>The Application</title>
<meta charset=utf-8>
<script src="http://{{req.headers.host}}/js/angular.min.js"></script>
<script src="http://{{req.headers.host}}/js/angular-route.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body ng-app="appOne">
<h1>Multiple apps on the same page</h1>
<div id="one" ng-controller="controllerOne">
<div>
<p>{{text}}</p>
</div>
</div>
<div id="two">
<div ng-view></div>
</div>
<div id="three" ng-controller="controllerThree">
<div>
<p>{{text}}</p>
<fishandchips></fishandchips>
<d data-fishandchips=""></d>
</div>
</div>
</body>
</html>
and I have the following app.js:
/**
* Create the app
*/
var appOne = angular.module('appOne', ['ngRoute']);
/**
* Configure routing - so controllerTwo runs
*/
appOne.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
template: '<p>{{text}}</p>',
controller: 'controllerTwo'
}).
otherwise({
redirectTo: '/'
});
}]);
/**
* Controllers
*/
appOne.controller('controllerOne', function($scope) {
$scope.text = '1';
});
appOne.controller('controllerTwo', function($scope) {
$scope.text = '22';
});
appOne.controller('controllerThree', function($scope) {
$scope.text = '333';
});
/**
* Directives
*/
appOne.directive('fishandchips', function() {
return {
restrict: 'AE',
template: 'Fish and <chips></chips> - Yamm'
};
});
appOne.directive('chips', function() {
return {
restrict: 'AE',
template: 'chips!'
};
});
Here is my flow:
[{"id":"29bd8c67.6e9464","type":"http in","z":"4ba1fb80.ec60a4","name":"","url":"/testme","method":"get","swaggerDoc":"","x":289,"y":155,"wires":[["e4aaf9f1.7e98a8"]]},{"id":"e4aaf9f1.7e98a8","type":"template","z":"4ba1fb80.ec60a4","name":"","field":"payload","fieldType":"msg","format":"handlebars","template":"<!DOCTYPE html>\n<html ng-app=app>\n <head>\n <title>The Application</title>\n<meta charset=utf-8>\n <script src=\"http://{{req.headers.host}}/js/angular.min.js\"></script>\n <script src=\"http://{{req.headers.host}}/js/angular-route.min.js\"></script>\n <script type=\"text/javascript\" src=\"app.js\"></script>\n </head>\n <body ng-app=\"appOne\">\n <h1>Multiple apps on the same page</h1>\n <div id=\"one\" ng-controller=\"controllerOne\">\n <div>\n <p>{{text}}</p>\n </div>\n </div>\n <div id=\"two\">\n <div ng-view></div>\n </div>\n <div id=\"three\" ng-controller=\"controllerThree\">\n <div>\n <p>{{text}}</p>\n <fishandchips></fishandchips>\n <d data-fishandchips=\"\"></d>\n </div>\n </div>\n </body>\n</html>","x":461,"y":140,"wires":[["b30cc9f2.4fe208"]]},{"id":"b30cc9f2.4fe208","type":"http response","z":"4ba1fb80.ec60a4","name":"","x":619,"y":218,"wires":[]}]
I keep getting an inject error:
at angular.js:38
at angular.js:4640
at q (angular.js:321)
at g (angular.js:4601)
at cb (angular.js:4523)
at c (angular.js:1758)
at Bc (angular.js:1779)
at fe (angular.js:1664)
at angular.js:31763
at HTMLDocument.b (angular.js:3207)
(anonymous) @ angular.js:38
(anonymous) @ angular.js:4640
q @ angular.js:321
g @ angular.js:4601
cb @ angular.js:4523
c @ angular.js:1758
Bc @ angular.js:1779
fe @ angular.js:1664
(anonymous) @ angular.js:31763
b @ angular.js:3207
Sf @ angular.js:3497
d @ angular.js:3485
Anybody have any idea on what I'm doing wrong?