angularjs - Render angular ui calendar from other controller using ng-click -
i using angularjs calendar ui creating events scheduler calendar. calendar hidden , on switch toggle displayed. calendar not rendered until next or prev month button pressed.
app.controller('togglecontroller', [ '$scope', function($scope) { $scope.toggleselection = function toggleselection(event) { angular.element(document.queryselectorall('.calendar-container')).css({display:'block'}); }; }]);
so want call render function calendar ui controller rendered on toggling view above controller
app.controller('calendarctrl', ['$scope','$rootscope', function($scope, $compile, $timeout, uicalendarconfig) { /* change view */ $scope.rendercalendar = function(calendar) { $timeout(function() { if(uicalendarconfig.calendars[calendar]){ uicalendarconfig.calendars[calendar].fullcalendar('render'); } }); }; }]);
i tried calling rendercalendar function using $rootscope
below error
$timeout not defined
oruicalendarconfig not defined
etc
dependency declaration , injection has same , in-order.
do :
app.controller('calendarctrl', ['$scope','$compile', '$timeout', 'uicalendarconfig`, function($scope, $compile, $timeout, uicalendarconfig) {\\
Comments
Post a Comment