Over a million developers have joined DZone.

AngularJS: Refresh or Die

DZone's Guide to

AngularJS: Refresh or Die

· Java Zone ·
Free Resource

Atomist automates your software deliver experience. It's how modern teams deliver modern software.

Just worked on my first AngularJS project at http://loveyyc.info (source code) and wanted to share my thoughts about it while the memory is still fresh. My impression in a one-liner:

AngularJS needs to rename a lot of things and introduce higher level abstraction

A great technology only becomes so because people feel happy about it. The happiness for people like me comes from the fact that not only I understand the technology well, but also find it to be easy to use. I think AngularJS is an amazing framework for building JavaScript apps. But oh boy, the barrier to entry is brutal to say the least. Their terminology makes it frustrating and very hard to compose a mental model of the framework.

But instead of just complaining and ranting, I wanted to suggest a few concrete refactorings. I think these refactorings would make my life way easier next time I’m about to introduce someone new to AngularJS:

//rename rootScope to pageState
var matchController = function($rootScope)...

var matchController = function($pageState)...

//rename controller$scope to controllerState
var matchController = function($scope)

var matchController = function($controllerState)

//introduce customTag, customAttribute as an abstraction over lower level directive

//example template <searchResult highligted></searchResult>

app.directive('searchResult', function(){
  return {restrict: 'E'}


//Use intention revealing name instead of symbols, uglifiers have a different job than humans


require: '^searchResult'

nestedInController: 'searchResult'

scope: {
  count: "&",
  count: "=",
  count: "@",

customTagState: {
  count: expression("count")
  count: twoWayBound("count")
  count: stringValue("count")

//BAD transclude -> really?
transclude: true

//always transclude, if the user has put content inside a custom tag. why not?

worksAsLayout: true

//linking is a low level concept. abstract using a higher level name



//why need a controller in directive


no controller required

//BAD -> $compile what?


//BAD -> $apply what?


//BAD filter -> means take a list and produce a sublist. It has little to do with most AngularJS filters


//BAD factory -> WTH


 I just wanted to share my 2 cents about it. I love this framework and I think it’s really good and productive once you understand the core concepts. But I strongly suggest the AngularJS team to take some time to simplify things. A refresh will save it and make it hugely successful or it’ll die like a champion fighter, who had all the right weapons but the wrong uniform.


Get the open source Atomist Software Delivery Machine and start automating your delivery right there on your own laptop, today!


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}