Right now, of the frameworks I’ve looked at, my favorite framework is React JS. But if I were picking a corporate framework, at this point I’d probably land on Angular 2.0.
But the question you are probably asking is , “Why two different selections?” And, I think a more interesting question would be, “How did you select which one to use?”
But an even more interesting question is this. What factors are essential when picking out a framework. If I ignored these questions, what are the cost?
I’ve written that I’m using Angular to write a couple applications before. One at my main contract and a couple side projects. I know I’m kind of late to the game, but one of my frustrations with the documentation around Angular is that very little of the sample code that you can find on the Internet shows the sample using anything close to a best practice. That’s the danger of writing about something you are too familiar with.
So, in this post, I’d like to cover a few best practices that I’ve discovered, or implemented in my own code, and explain in a bit more detail what is going on inside the controller. I concentrate on the controller because this is a place that will be used the most. Once you understand it, the rest of what you need to know will trickle down to services, factories, and directives.
I’ve been looking at Angular.js recently. I’ve already got enough of a project done in MongoDB (with Mongoose), Express, Angular and Node.js (MEAN) to be comfortable with how Angular works. But I wanted to give it a try using ASP.NET as the back end. I’m always learning. Always improving.
To start out, I just setup an index.html page to hold my basic form as I got the basic look and feel going. But as I progressed, I wanted to make sure I progressed, I wanted to add in the capability of using Angular’s html5mode for the client side routing.
Out of the box, Angular, and most other frameworks that implement client side routing, using the hash symbol to specify the route. For example
This allows the routing to work on older browsers.