Skip to main content
Home  ›  Blog

Stop using $scope - learn AngularJS Best Practices an DNN-Connect

There are many bad code-samples showing you how to use AngularJS - and following these will make work with AngularJS confusing and difficult. A typical mistake is to use $scope in your code - something that was a good idea 3 years ago but not any more. Let me tell you more...

We all start with other peoples samples...

I started coding AngularJS based on samples out in the internet - and most people start this way. It's a very difficult way, because almost all samples are so trivial that they don't cover normal use cases - and building an application on that leads to chaos. I basically had to re-learn AngularJS a few times - but then found out that "It would be very simple, if you start the right way".

So at DNN-Connect in Millau I'll teach you how to build simple and complex AngularJS Apps - and why it's very easy to do - even for beginners - if you follow best practices.

Common mistakes I'll help you avoid are

  1. Creating complex code for simple solutions
  2. Using $scope in your code or even worse $apply
  3. Building very simple, or very complex folder structures
  4. Using the DNN ServiceFramework from within your Controllers (yes, you should really not do that)
  5. Using the DNN ServiceFramework from within your Services (yes, this too is not really a good idea)
  6. Not leveraging Dependency-Injection
  7. Assuming that you have a SPA (single page application) when DNN actually allows many modules on a page
  8. ...and much more

Join the Session on Saturday

We learned this and much more the hard way, you can have it all for free in 40 minutes on Saturday at the DNN-Connect in Millau. See you there!

With love from Switzerland,
Daniel 


Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in Switzerland and Liechtenstein, an 20-head web specialist with over 800 DNN projects since 1999. He is also chief architect of 2sxc (see github), an open source module for creating attractive content and DNN Apps.

Read more posts by Daniel Mettler