Back to articles
1 min read

Why would anyone start learning Angular 1 today?

A quick primer on why AngularJS is still worth learning and a simple three-step getting-started guide.

Gert Jansen van Rensburg

Gert Jansen van Rensburg

Software Consultant

Why in the world would you want to start learning Angular now when so many other frameworks are about to be released? For me the biggest reason is that all the hard problems have already been solved in Angular 1.

Getting Started with Angular 1

Where should you begin? I’d start with CodeSchool’s Angular course-it explains the basics better than any other site or blog post I’ve found.

Step 1

Let’s create a simple web page.

  • Create a folder: mkdir example
  • Create a file in that folder called index.html with the content below.
<html>
<body>
    <div>Hello World<div>
</body>
</html>
  • Double-click index.html and you should see a page that says “Hello World”.

Step 2

Replace the content in index.html with the snippet below.

<html data-ng-app="app">
<body>
    <div data-ng-controller="Shell as vm">{{vm.greeting}}<div>

    <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.js"></script>
    <script>
        (function() {
            angular
                .module('app', [])
                .controller('Shell', Shell);

            function Shell() {
                var vm = this;
                vm.greeting = "Hello World";
            }
        })();
    </script>
</body>
</html>

Step 3

Get creative-your imagination is your only limitation.

Comments

Share your thoughts and join the discussion below.