我在获取一个简单的 clojurescript 程序以在高级模式下正确编译时遇到问题。例如,这是一个简单的程序
(ns cljs-basics.core)
(.write js/document "hello, cljs")
(def basicsApp (.module js/angular "basics" (array)))
(def testController
(.controller basicsApp "TestCtrl" (fn [$scope])))
(aset testController "$inject" (array "$scope"))
和html文件:
<!doctype html>
<html ng-app="basics" lang="en">
<head>
<meta charset="utf-8">
<title>Simple CLJS</title>
<script src="components/angular/angular.js"></script>
<script src="js/basic.js"></script>
</head>
<body ng-controller="TestCtrl">
{{testvar}}
</body>
</html>
代码在 :simple 上运行良好,但是当我打开 :advanced 时,它就不起作用了。和调用被编译为符号.controller
,.module
所以我得到
Uncaught TypeError: Object #<Object> has no method 'Uf' basic.js:5105
Uncaught Error: No module: basics
有没有办法以某种方式包含 angular.js 文件,以便编译器可以将所有内容一起缩小?