People,
I asked for help to retrieve the value of a variable in a js file by $ rootScope that is in the controller of my application. My intention is to retrieve in the hmtl page this attribute to be able to display the system version.
When running the application, the message: $ rootScope.app is undefined
infoBuild
var VERSAO_SISTEMA = '01.02.00.002';
Controller
angular.module ('webApp') .controller ('ImrController',
function ($scope, $rootScope, $translate, $http, $timeout, Log, WebServiceX, Alert, Analytics, Error, Utils, WebServiceRest, WebServiceT) {
Log.debug("ImrController()");
Analytics.trackEvent('controller','ImrController');
$scope.container = {};
$rootScope.currentview.id = 'iMR';
$rootScope.currentview.group = 'IMR';
$rootScope.currentview.title = 'IMR';
$rootScope.currentview.icon = 'fa-list-alt';
$rootScope.currentview.locked = false;
$rootScope.currentview.menu = true;
$rootScope.currentview.description = 'IMR';
$rootScope.app.version.id= VERSAO_SISTEMA;
//Preenchimento da data da ultima carga
$http.get('/siigf/ws/imr/dataUltimaCarga').
then(function(response) {
$scope.dataUltimaCarga = response.data;
});
Html
{{app.name}} {{app.version.id}}
{{app.version.name}}
I also imported the infoBuild.js file into index.html
The project is angled JS
Thank you!