Home » Posts tagged "angular.js"

How Not to Choose a Framework

In my job as a JavaScript architect, trainer and mentor, I’m often asked, “What’s your favorite framework?”  Or “What is the best framework?” And it surprises people when I give them two answers to that question.

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?”

In fact, when I was thinking about writing this post, I was going to title it “How to Choose a JavaScript Framework” but as I considered what I would actually say, I realized that the factors I would use really apply to any language and any time.

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?

So, I give you…

How Not to Choose a Framework
Photo credit: Tony Webster via Visual hunt / CC BY

Continue reading “How Not to Choose a Framework”

Are You Doing Angular Right?

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.

image

Continue reading “Are You Doing Angular Right?”

Create A Desktop Application using Angular, Bootstrap and C#

Last week I mentioned that it is possible to create a desktop application using JavaScript and that I had actually started working on an application that used Angular and Bootstrap for the presentation layer.  I actually have enough of that working that I can share the “how-to” with you.

image

Continue reading “Create A Desktop Application using Angular, Bootstrap and C#”

ASP.NET, Angular.js & html5mode

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.

For those of you who are new to Angular, Angular is a client side JavaScript framework that will allow you to create web applications where much of the processing happens on the client side instead of the server side.  That’s cool enough.  But it also adds the ability to handle client side routing, just like ASP.NET’s MVC handles server side routing.  This allows you to have a client side “master page” that can suck in the differences from the server as it needs them based on the url that is in the address bar.  In fact, there is an extension that will let you have sub routes as far down as you need.

Out of the box, Angular, and most other frameworks that implement client side routing, using the hash symbol to specify the route.  For example

http://blog.dmbcllc.com/index.html#/pathToRoute

This allows the routing to work on older browsers.

ASP.NET, Angular.js & html5mode

image Continue reading “ASP.NET, Angular.js & html5mode”