Category: AngularJS

The anchorScroll service in AngularJS allows us to jump to the specific HTML element in the web page. When this gets called then it adds [#element-id] on the URL which you can remove with few more line of code.

It has the dependency on $location service for hash the id on the URL and the anchorScroll reads the hashed string and looks for the given id in the web page and jump to it.

Scroll to given element with anchorScroll service in AngularJS

AngularJS

Load more pagination allows the users to load new content on a button click. This appends new content with existing contents.

It is the type of infinite pagination where the user has to click the action button to view new records. This load data until records are available.

In this tutorial, I am implementing this functionality on a page with AngularJS and PHP.

Load more pagination with AngularJS and PHP

AJAX AngularJS PHP

Most of the eCommerce sites e.g. Flipkart, Snapdeal, etc have a price range slider for searching purpose.

The user doesn’t have to enter price range manually.

It will automatically filter the list when the price is been changed by the user.

In this tutorial, I am implementing the similar type of functionality with AngularJS and PHP.

Using jQuery UI to create the slider.

Make Price Range Slider with AngularJS and PHP

AngularJS PHP

It is always a better idea to check the entered username exists or not if you are allowing the users to choose username while registration and wants it to be unique.

With this, the user will instantly know that their chosen username is available or not.

Check if username exists with AngularJS

AngularJS PHP

The autocomplete functionality gives the user suggestions based on its input. From there, it can select an option.

In the demonstration, I am creating a search box and display suggestion list whenever the user input value in the search box.

Set selected value to search box when an option gets selected.

For implementing this functionality I am using AngularJS and PHP.

Create autocomplete search with AngularJS and PHP

AngularJS PHP

The check uncheck all functionality mainly required when the long list of records available on the page and allowing the user to select multiple records to perform an action.

For example – Delete the selected user’s list, in this case, if require deleting all users then it needs to select one by one.

This can also be used on the limited number of list items.

I show you some of the examples for check uncheck all checkboxes with AngularJS.

Check uncheck all multiple checkboxes with AngularJS

AngularJS

If you know how to add or remove record to MySQL database table with jQuery AJAX then it’s been a lot easier for you to do with AngularJS.

Using PHP for handling requests and according to it execute the action and return response.

In the demonstration, I created a layout for entering new records and show the list of records in table layout with a delete button.

Add and remove record from MySQL Database with AngularJS

AngularJS

For upload file with AngularJS need to send the file by $http service and with the use PHP store the requested file to the server and return a response.

In the demonstration, I am creating two examples –

  • In the first, using JavaScript to select file,
  • And in the second, using custom directive

Then pass it as data in $http service for upload.

Upload file with AngularJS and PHP

AJAX AngularJS

With only using AngularJS it is not possible to get data from MySQL database because it only handles Client side requests.

You have to use any Server side language at backend which handles the request and returns response.

In AngularJS $http service is use to send AJAX request.

How to get data from MySQL with AngularJS - PHP

AngularJS

AngularJS