I am trying to populate a textaread with a variable which i have parsed from a file. textarea gets data from a controller when popup is called. This controller gets data from another controller which has parsed the data. But it gives error on injecting. Please help.
Steps to reproduce the behaviour 1. I have a viewXML controller ///Creating controller for ViewXML - Data will be displayed in text area
angular.module('fbsiperf').controller('ViewXMLCtrl', ['$scope','successcount',function($scope,successcount) {
$scope.successcount=successcount;
$scope.cancel = function() {
$scope.$dismiss();
}
}])
2. It gets data from below function
angular.module('fbsiperf').controller('zScriptResultsCtrl', [ '$scope', '$http', '$state', '$stateParams', '$uibModal', 'Upload', function($scope, $http, $state, $stateParams, $uibModal, Upload) {
var rowRendered = 0;
init();
function init() {
/** *******method list: get Data *************** */
$http.get("/xml/getResults").success(function(data, status) {
$scope.results = data;
$scope.totalScripts = data.length;
var success = 0;
var fail = 0;
$scope.symbolicViewList = [];
$scope.mauiViewList = [];
$.each($scope.results, function(index, element) {
if (element.result != null && element.result == "Passed") {
success++;
} else {
fail++;
});
$scope.successCount = success;
$scope.failCount = fail;
});
}
var symbolicViewSearch = null;
var mauiViewSearch = null;
var prodCodeSearch = null;
var zscriptResultDefs = [
{
headerName : "View XML",
field : "viewXML",
width : 150,
unSortIcon : true,
cellRenderer : function(params) {
return "<a ng-click=\"viewXML()\">XML</a>";}
},{
headerName : "MAUI View",
field : "mauiView",
width : 150,
unSortIcon : true,
filter : 'text'
}
// View XML
$scope.viewXML = function() {
//if(null != $scope.ticket && "" != $scope.ticket) {
if(true) {
//open modal for adding data
var modalInstance = $uibModal.open({
templateUrl : '../../views/templates/viewXML.html',
controller : 'ViewXMLCtrl',
windowClass : 'center-modal',
backdrop : 'static',
keyboard : false,
size : 'lg',
resolve : {
successcount : function() {
console.log($scope);
console.log($scope.successCount);
return $scope.successCount;
//return "Name";
}
}
});
} else {
alert("No CM# found")
}
}
3. i am displaying it in html here
<textarea rows="4" cols="50" ng-model="successcount"></textarea>
instead of populating the text box i get error as
[$injector:unpr] Unknown provider: successcountProvider <- successcount <- ViewXMLCtrl