I'm working on Salesforce Visualforce template and components, I have the below code embedded and I'm trying to fix the bug.
I did check the similar link here : AngularJS error: [ng:areq] Argument 'TestController' is not a function, got undefined
<div xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" ng-app="vsTestApp">
...
<c:TestController />
<c:TestTemplate />
...
</div>
The code for TestController
<apex:component >
<script>
(function() {
'use strict';
angular
.module('vsTestApp', []);
}());
(function() {
'use strict';
angular
.module('vsTestApp')
.controller('testController', testController);
testController.$inject = ['$filter', '$window' ,'$rootScope' ];
function testController($filter, $window , $rootScope) {
//Some Logic's Here
function print() {
$window.print();
}
}
}());
</script>
</apex:component>
The code for TestTemplate
<apex:component >
<script type="text/ng-template" id="vlcCompareModal.html">
<a clasS="btn btn-default" ng-controller="testController as smallGroup" ng-click="smallGroup.print()">Print</a>
</script>
</apex:component>
I'm getting error saying Argument 'testController' is not a Link : https://docs.angularjs.org/error/ng/areq?p0=testController&p1=not%20a
testController.$inject = ['$filter', '$window' ,'$rootScope' ];and thenapp.controller('testController', testController)