Javascript 我想在anguarJS中使用SVG时隐藏/显示我的SVG元素

Javascript 我想在anguarJS中使用SVG时隐藏/显示我的SVG元素,javascript,angularjs,svg,Javascript,Angularjs,Svg,有谁能给我推荐一个JS函数,让这个SVG可见,因为它在没有角度JS的情况下工作得很好 <div class="app" ng-app ng-style="disableCircle"> <div ng-controller="ctrlSizing"> <label id="rad" style="visibility: hidden">Radius: <input ng-model="rad" type="number" plac

有谁能给我推荐一个JS函数,让这个SVG可见,因为它在没有角度JS的情况下工作得很好

<div class="app" ng-app ng-style="disableCircle">
    <div ng-controller="ctrlSizing">
        <label id="rad" style="visibility: hidden">Radius: <input ng-model="rad" type="number" placeholder="How about 300?"></label>
        <div id="circle" style="height: 800; width: 500; position:absolute; left: 100px;top: 100px;">
            <svg width="500" height="500" visibility="visible" onclick="cInput()" >
                <circle id="circle1" cx="150" cy="150" ng-attr-r="{{rad}}" stroke="black" stroke-width="2" fill="grey" />
            </svg>
        </div>
    </div>
</div>
<div>
    <input id="button1" type="button" value="Circle" onclick="circleDraw()">
</div>

半径:

使用JS隐藏通过id检索的元素或遍历DOM

svgElement.style.display = "none";

有关如何使用JS与SVG交互的更多信息,可以查看本文

svgElement.style.opacity = 0;