Q:

Migrating Conditional Styling From jQuery to AngularJS

I'm making my first Angular app and am struggling with the thought processes behind conditionally styling the DOM in AngularJS.  
I was previously doing this in jQuery like so: 
containerWidth = lineWidth / numberOfObjects;
$container.css('width',containerWidth);
So if there's 1 object the width is 100% and if there are 5 the width becomes 20%.  
I'm unsure whether to do this in link, inside a directive or in the controller itself?  

A:

Please see ng-style 
Example:
<div ng-style="divStyle" />

and JS:
$scope.divStyle = {'width' : (lineWidth / numberOfObjects) + 'px;' };

(I don't know where lineWidth comes from... but that's the idea)

