Skip to content
Advertisement

Getting an issue in applying margin on the runtime using angular

I have an li element in which we are calling a method SiteAssetStyleForShiftedAsset like this:

JavaScript

and from our javascript controller it being called like this:

JavaScript

So it is working fine in the first if (isPPMJob == “FALSE”) but in else if where we are checking shiftingAsset.toUpperCase() == “TRUE” that margin is not being applied.

Tried alerts on all conditions they are showing fine but margins are causing problems.

Advertisement

Answer

I found solution for that problem. The problem was with HTML code we were using data-ng-style like this

JavaScript

instead of this we have to use it like

JavaScript

Then in JS controller just return value of margin i.e. “10px” , “50px”,etc

function SiteAssetStyleForShiftedAsset() {

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement