| by Gagandeep Singh | No comments

Showing HTML content in AngularJS expressions

AngularJS will remove any HTML markup that you want to display on the screen using an expression. For example. $scope.message=”Welcome to pixxstudios”; and expression is: {{message}} When Angular tries to execute this expression, it will remove any HTML markup it finds ( in this case and ) and will convert it to normal text. So […]

Read More
| by Gagandeep Singh | No comments

Using Filters in AngularJS

As mentioned in the previous post, we use ng-repeat directive to iterate through a set of values. There may be certain scenarios in which we might need to pre-process the data below updating or displaying it on the page. For example, we might need to convert all the cities which we need to display on […]

Read More
| by Gagandeep Singh | No comments

Expressions in AngularJS

In our using Directives in AngularJS post we explained basics about the directives. Directives are used to add new attributes to the HTML tags. On the other Expressions in AngularJS are used for data-binding. The syntax used for data-binding is {{ }}. Let us consider the following example. Name: You wrote: {{ company }} In […]

Read More
| by Gagandeep Singh | No comments

Directives in AngularJS

HTML is used to created static pages, but AngularJS takes it one step ahead by providing functionality to add new attributes to the HTML tags. These attributes which AngularJS provides are called directives and they have a prefix ng-. Example.

Read More
| by Gagandeep Singh | No comments

Custom function to sort string array in JavaScript

JavaScript provides an inbuilt function sort() to sort the elements inside an array. For example. Let us consider the following array var numbers=[5,3,6,2,7,1]; We can easily sort it using sort() method. numbers.sort(); output – [1,2,3,5,6,7] Same will be case in case the arrays is made up of string elements. var str=[‘a’,’g’,’t’,’a’,’b’]; str.sort(); output – [ […]

Read More
  • 1
  • 2