http://kimagureneet.hatenablog.com/entry/2015/01/19/050000
I am referring to the above page.
ng-style="{width:'400px'}"
How should I write this '400px' as a variable?
javascript angularjs
If you register properties with $scope
in the controller, you can configure them with {{property name}}
.
JavaScript
$scope.widthValue="'400px'";
HTML
<div ng-style="{width:{{widthValue}}}">
© 2024 OneMinuteCode. All rights reserved.