This example compiles with :optimizations :advanced.

(ns gameapp)
(def gamemod
"Create a gameapp module within Angular.js"
(.module js/angular "gameapp" (array)))
(.directive gamemod "gameslist"
(fn []
(js-obj
"restrict" "E"
"scope" (js-obj "games" "=")
"template" "<div ng-repeat='game in games'>Game {{game.name}}</div>"
)))
(defn ^:export GameCtrl [$scope]
(aset $scope "mygames" (array
(js-obj "name" "a")
(js-obj "name" "b")
(js-obj "name" "c"))))
(aset GameCtrl "$inject" (array "$scope"))
<!doctype html>
<html ng-app="gameapp">
<head>
<script src="angular.min.js"></script>
<script src="cljs-w-directive.js"></script>
</head>
<body>
<h2>Game names</h2>
<div ng-controller="gameapp.GameCtrl">
<gameslist games="mygames"/>
</div>
</body>
</html>