I have an angular control panel and set the root area value in the control panel and access this root area value in the component inside the control panel template using the area ... but I donβt know if it is right or not .. and I canβt get this value
function DashBoardController($http, $window, $rootScope, apiurl, $scope, $location,$interval) { var ctrl = this; ctrl.$onInit = function () { getUser(); }; function getUser(){ $http({ method: 'GET', url: apiurl + '/getUser', }).success(function (data, status) { if (data.status == true) { $rootScope.user = data.result; $rootScope.test = "TEST"; } }); } function Controller1($rootScope,$scope, $timeout,$http, apiurl,$interval) { var ctrl = this; $scope.value = $rootScope.test; alert($scope.value); $scope.value1 = $rootScope.user; console.log($scope.value1); } app.module('app').component('component1', { templateUrl: '../resources/views/component/component1.html', controller: Controller1 }); })(window.angular);
am get undefined
source share