[英]generate JavaScript code in an Angularjs component
I would like to generate JavaScript code 我想生成JavaScript代码
<script>
...
</script>
in a component variable and use this variable let's say scriptJs
in the template of the component 在组件变量中并使用此变量,假设组件模板中的
scriptJs
{{ scriptJs }}
Is that possible? 那可能吗? If not, how I can solve the problem?
如果没有,我该如何解决?
<body ng-app="myApp" ng-controller="myCtrl">
{{scriptJs }}
</body>
<script>
var c=angular.module('myApp',[])
c.controller("myCtrl",function($scope){
$scope.scriptJs ="imtah"
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.