I've been at this for 30 minutes and cannot figure out what I am doing wrong...
HTML:
<div ng-controller="main">
<div ng-style="mapheight">
<google-map center="center" zoom="zoom" style="height: inherit;"></google-map>
</div>
</div>
CONTROLLER:
angular.module('csApp.controllers', ["google-maps"]).
controller("main", function($scope) {
$scope.mapheight = "{'min-height':" + getHeight() + "px;}";
$scope.center = {
latitude: 45,
longitude: -73
};
$scope.zoom = 8;
function getHeight() {
return (window.innerHeight * .70);
}
})
No style is being applied to my div at all.
I can get it pass the variable when I put {{mapheight}} in my template but then I have to pass it to the style property, which is apparently not how I should do it.
What am I doing wrong here? This is my first day with angular and I'm almost in tears because I can't even resize a div.
Thank you!
here is the change in my controller:
$scope.mapHeight = { 'min-height': getHeight() };