These are chat archives for angular/material

22nd
Sep 2015
Bhupinder Singh
@dynamicsingh
Sep 22 2015 04:55
@Tallyb @shprink Thanks a lot :)
Julien Renaux
@shprink
Sep 22 2015 04:56
no problem :)
adilogin15
@adilogin15
Sep 22 2015 06:27
Hi does any one knows how to call a variable inside a controller to style (for ng-style) in angular ?
Here is my code
    app.factory('aspectratio', function() {
    return {
        name : 'anonymous'
    };
});
/*global angular*/
angular.module('Dhanax').controller('SideSliderController', ['$scope','$sce',function($scope, $sce) 
{
    var app = angular.module('resizeApp', []);//This app will be used with ng-app in index.handlebars

    function AppController($scope)//This controller will be used with ng-controller in index.handlebars 
    {
        $scope.Height = $(window).height();
        $scope.Width = $(window).width();
        var browserheight = angular.element($scope.Height);
        var browserwidth = angular.element($scope.Width);
        var    ratio=(browserheight/browserwidth);
         return ratio;
    }

    app.directive('resize', function ($window) 
    {
        return function (scope, element) 
        {
            var newwindowsize = angular.element($window);
            scope.getWindowDimensions = function () 
            {
                return {'newheight': newwindowsize.height(),'newwidth': newwindowsize.width()};
            };
            scope.$watch(scope.getWindowDimensions, function (newValue, oldValue) 
            {
                scope.windowHeight = newValue.newheight;
                $scope.style = function ()//this function will be used with ng-style in index.handlebars
                {
                    return{'height': (newValue.newheight) + 'px','width': (newValue.newheight*ratio) + 'px'};
                };
            }, true);
            newwindowsize.bind('resize', function ()
            {
                scope.$apply();
            });
        };
    });
}
]);
problem is i am getting error in $scope.style = function () that ratio is not defined define it as /*global*/
Chris Beckett
@chrismbeckett
Sep 22 2015 20:18
Hey All, looking for some assistance getting animations working. Been following the issues on Github related to animations working with Angular 1.3 but not 1.4, etc. Apparently, they have all been resolved now, but not for me. I am running Angular 1.4.6 and Angular Material 0.11.0 and none of the animations work (Sidebar, FAB button). FYI - when the sidebar is opened, I don't see a shaded backdrop either.