I'm getting a compile error when injecting my service into my controller. The expected output of this app should be just the text "hello" on the web page.
<!doctype html>
<html>
<head>
</head>
<body ng-app="ddApp">
<div ng-controller="ddController">
<div svc-show-meetings template="{{template}}">
</div>
</div>
</body>
<script>
var ddApp = angular.module('ddApp', [])
ddApp.factory('svcMeetingsTemplate', function ()
{
return function ()
{
return "<div>Hello</div>";
};
});
ddApp.directive('svcShowMeetings', function ($compile)
{
return {
scope: true,
link: function (scope, element, attrs)
{
}
};
});
ddApp.controller('ddController', ['$scope', 'svcMeetingsTemplate', function ($scope, svcMeetingsTemplate)
{
$scope.template = svcMeetingsTemplate();
}]);
</script>
</html>
Fiddle: http://jsfiddle.net/Xp5BF/1/
I'm obviously doing something wrong. I built this using some code posted here in SO: https://stackoverflow.com/a/14846975/753632