数学函数sin和cos为angularjs

时间:2014-01-17 07:57:56

标签: javascript jquery ajax json angularjs

嗨我想在angularjs中使用sin和cos函数。我已经搜索了它,如果你们有任何其他的想法,如何在angularJs中实现sin和cos函数,请帮助我。

3 个答案:

答案 0 :(得分:2)

只需使用javascript Math对象:

 $scope.Math = Math;    

<强> HTML

<div ng-app='app' ng-controller='OuterCtrl'>        
        {{Math.sin(3)}}        
</div>

演示 Fiddle

答案 1 :(得分:1)

你不必使用Angular,javascript函数是already there Math.sin(x)

答案 2 :(得分:0)

我在javascript Math.sin(x)Math.cos(x)中都有这个功能。