Web Development

AngularJS tips for beginners

AngularJS is an open-source JavaScript framework which is owned by Google, to assist developers when creating single-page applications. AngularJS allow the use of HTML code as a ‘blue-print’ template and use pre-defined data-binding, form validation and DOM manipulation to assist in writing cleaner code and base everything on a framework, (e.g bootstrap).

Initializing our model app:

AngularJs allows us to name our model app, code below:

 <div ng-app="myApp">
    <div ng-view></div>

“myApp” is the name of our application that we are declaring, which you can name to what you like.

Creating hyperlinks:

Creating links in AngularJS is easy and can be accomplished by using ng-href.

<a ng-href src="/">This is our home page</a>
<a hg-href src="/about-us">This is our about-us page</a>


Data binding, is expressed in the form of{{}} and allows you to auto sync data between the view and application model. The code example below will display the value of coffee that is binded to the paragraph element.

 <p ng:bind=”coffee”></p>


The angularJS website www.angularjs.org, is the ultimate source for learning more about the code base and framework; they also have a wide collection of code tutorials and modules which can be installed from Angular Modules, www.ngmodules.org.

Leave a Reply

Your email address will not be published. Required fields are marked *