我制作了一个程序,允许用户在“白板”上书写文本并实时更改颜色。我现在正试图让用户也能够更改字体大小。如何将“writing_size”变量与字符“px”结合起来形成“font-size”的值?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<title>AngularJS Whiteboard</title>
</head>
<body>
<div ng-app="">
<textarea name="message" rows="10" cols="30" ng-model="writing">
</textarea>
<span> Marker color: <input type = "text" size = "7" ng-model="marker_color"></span>
<span> Writing size: <input type = "text" size = "7" ng-model="writing_size"></span>
<br>
<br>
<div id = "whiteboard" ng-bind="writing" ng-style="{ color : marker_color, font-size: {{writing_size + 'px'}} }">
</div>
<div id = "test">
{{ writing_size + "px"}}
</div>
</div>
</body>
</html>