ANN - purnam beta 0.1.0 - javascript, jasmine and angularjs extensions for clojurescript

63 views
Skip to first unread message

z...@caudate.me

unread,
May 21, 2013, 8:44:35 AM5/21/13
to ang...@googlegroups.com
I'm really excited to show everyone what I've been working on for the past couple of weeks.....

I wist that more javascript people will start using clojurescript and hope that my library might get more people interested

What is Purnam?

Starting Points:


Here are some simple examples

Angular JS
;; purnam.angular

(def.module my.app [])

(def.config my.app [$routeProvider]
  (-> $routeProvider
      (.when "/" (obj :templateUrl "views/main.html"))
      (.otherwise (obj :redirectTo "/"))))

(def.controller my.app.MainCtrl [$scope $http]
  (! $scope.msg "")
  (! $scope.setMessage (fn [msg] (! $scope.msg msg)))
  (! $scope.loginQuery
     (fn [user pass]
       (let [q (obj :user user
                    :pass pass)]
         (-> $http
             (.post "/login" q)
             (.success (fn [res]
                         (if (= res "true")
                           (! $scope.loginSuccess true)
                           (! $scope.loginSuccess false))))
             (.error (fn [] (js/console.log "error!!")))))))
AngularJS Testing
;; purnam.test.angular

(describe.controller
 {:doc "A sample controller for testing purposes"
  :module my.app
  :controller MainCtrl}

 (it "should be able to change the message within the $scope"
  (is $scope.msg "Hello") 
  (do ($scope.setMessage "World!")
      (is $scope.msg "World!"))

  (do ($scope.setMessage "Angular Rocks!")
      (is $scope.msg "Angular Rocks!"))))

Miguel Ping

unread,
May 21, 2013, 9:27:59 AM5/21/13
to ang...@googlegroups.com
Looks great! I'm gonna give it a try!

Chris Zheng

unread,
May 21, 2013, 4:33:46 PM5/21/13
to ang...@googlegroups.com
Great! I'd really love some feedback. I find that my code is reduced by about a half or more with clojurescript but I'm not that familiar yet with angular so the demos suck at the moment :)

Rafael Nami

unread,
May 21, 2013, 4:50:08 PM5/21/13
to ang...@googlegroups.com
Wow! Just what I've been looking for!!!
I'm a big fan of LISP and Clojure, so this would fit quite nicely for my personal projects! I 'll give it a try for sure!


2013/5/22 Chris Zheng <z...@caudate.me>
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

z...@caudate.me

unread,
May 21, 2013, 7:48:50 PM5/21/13
to ang...@googlegroups.com
Thanks Rafael!

Do let me know if the documentation is unclear so I can add more docs/clear up the mistakes. I am an independent developer so I am using the library on a couple of new projects I am working on so everything has been quite thoroughly tested, although I haven't had time yet to do more comprehensive docs.
Reply all
Reply to author
Forward
0 new messages