4 ms·
I'm on my second quest to understand, really understand, how AngularJS fits together. Forensically decomposing the documentation. It's quite slow going, actuall
by jacques_chester 13y ago
I'm on my second quest to understand, really understand, how AngularJS fits together. Forensically decomposing the documentation. It's quite slow going, actually; I find myself relying on the code to explain the documentation about as much as the documentation describes the code.
My current suspicion is that directives do not get the central billing that they deserve. If you come from other backgrounds, the first thing you wonder about is the whole MVC thing.
But then you look at compile phase, link phase and runtime loop. They are dominated by directives and the code that directives set up.
It seems to me that a big design step in AngularJS is to extend HTML into the DSL you wish existed. This is done with directives.
I'm still going through this process so it might well turn out that when I get to other parts of the manual my perspective will change entirely.
- e12e 13y agoI'd love to see some good resources on back-end integration; specifically: best practices to ensure ssl-only cookies/sessions, securing the back-end (authorization, input handling/sanitazion), a suggestion for a safe, reasonably scalable backend (ie: not mongodb, maybe postgres, couchdb over ssl (with certificate verification[1]!), riak or even mysql with a php ajax api in front -- although I'd prefer keeping the range of technologies to a minimum so maybe a nodejs api server with something durable for permanent storage) -- and a suggested organization of the whole app with tests (some reasonable way to map models between the backend DDL/SQL and the angular end would be nice). I see a lot of demos that throw together a few widgets -- but leave you no closer to anything remotely useful -- because they either include completely unsafe data across domains, or throw things in some kind of globally writeable store that isn't even useful for a public wiki, because there are no way to control anything that goes into the backend. Does anyone have any good articles/sample projects to recommend? All that said, I really enjoyed this article -- it does a great job of presenting the parts that angularjs is actually about: the client side. I just sometimes feel tutorials focus too much on just angularjs - for most apps we want shared persisted data after all, right? (even if you're just sharing it with yourself, on a different client (eg: todo list in desktop browser and on mobile browser)). [1] I just looked into couchdb again, and I think I'm getting a handle of how one might actually deploy the thing -- but it's a little scary to see that they by default turn off ssl cert validation -- which is just wrong -- when ssl is off by default anyway. Why would anyone enable SSL, but not want secure communication? For the slowdown?
- coolsunglasses 13y agoThe backend is not the hard or alien part. Just use Postgres if you don't have very specific, very unusual, and very well understood needs.
- e12e 13y agoI'm assuming you're not advocating having postgersql serve up html and javascript, and listen on ssl connections directly from the clients. So you'll need some middleware, and there's no good reason why you shouldn't be able to keep your model and validation logic in one place - I'm guessing one of the easiest approaches, if you're using an sql database, is to use nodejs for the middleware, sharing as much as possible of validation and model-code between the api server and the client? I think having to fix three different code-bases on every model change/feature addition is going to be a problem (SQL, PHP/Scala/Ruby/Python, and javascript + bonus fourth language if you use templates...). I'm not saying it can't be done, I'm saying there has to be a better way?
- coolsunglasses 13y agoI typically use Clojure serverside and JS or ClojureScript client-side with a PostgreSQL database backing persistence.
- davemo 13y agoI've got a couple [1] of screencasts [2] that go into detail on the integration side of things; I chose to integrate with Laravel (PHP) and MySQL purely for mass-market appeal but the lessons learned should be widely applicable to any stack: [1] - End to End with Angular JS - http://www.youtube.com/watch?v=hqAyiqUs93c http://www.youtube.com/watch?v=hqAyiqUs93c [2] - Security with Angular JS - http://www.youtube.com/watch?v=18ifoT-Id54 http://www.youtube.com/watch?v=18ifoT-Id54
- juddlyon 13y agoI've been working on a an Angular app recently and have found your videos quite helpful. Thank you!