Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:40:07+00:00 2026-06-16T00:40:07+00:00

Im creating a website and I chose to do it in AJ. I have

  • 0

Im creating a website and I chose to do it in AJ.
I have two folders:
Gateways => some php files which retrive data from a mysql db and echos the data as json.
Views => Partial html files which are basically the template for each page. eg Users, Items, etc.

then I have a index.js file which handels the request process and routing:

angular.module('Index',['addon'],function($routeProvider,$locationProvider){
    $locationProvider.html5Mode(true).hashPrefix("!");
    $routeProvider.otherwise({
        templateUrl: '/views/index.html',
        controller: "index"
    }).when("/items/",{
        templateUrl: '/views/items.html',
        controller: "items"
    })
}).
controller("index",function($scope,$http){

    $scope.users = [];
    $http.get("gateways/list.php").
    success(function(d){
        console.log(d);
        if(angular.isArray(d)){
            $scope.users = d;
        }
    });

}).
controller("items",function($scope,$http,$routeParams){
    $scope.items = [];
    $http.get("gateways/single.php").
    success(function(d){
        if(angular.isArray(d)){
            $scope.items = d;
        }
    });

}).

What is the point of all this route providers in AJ except its elegancy?
Dont they just slow down the site because of number of the requests?
I could just write the php code from the gateways files directly in the templates files?
Am I doing it in the wrong way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:40:07+00:00Added an answer on June 16, 2026 at 12:40 am

    You might be missing the point of using frameworks like AngularJS. They are mostly for Single Page application and ajax intensive. And let me begin that the number of requests don’t really slow down application. Remember how Gmail used to be at first without Ajax ? Was it faster than the current implementation ?

    Now, when you build a single page application, the app sends req to server and server responds in JSON or XML. In frameworks like AngularJS or any other, server sends the JSON response and we render them using client side templates or DOM. This saves enormous resource from the server side since server doesn’t have to parse the array and render the template. So if server had to render a table which has 100 rows, the bandwidth to send to your browser might be 20KB whereas only JSON might be 5KB and a string or DOM template with 1KB to do the rendering. So, you’re actually having your visitor’s browser do a lot of job. It’s all about calculations/computations. Think of a statistics table where there are columns and some computed values to be presented in a data grid. With Client side frameworks, your server would just respond as JSON and browser (with JavaScript) will parse,calculate and render it in template.

    As for the question of using a routerProvider, it’s essential to bookmark and use browser navigation button. Just like a traditional url has a view, a URL in client side app has a view which should be bookmarkable and should support navigation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a multi-language website. I have resource files lang-en , lang-fr , lang-fa.
I have been assigned the task of creating some graphical stats for a website,
I am new to Asp.net I am creating website which have DropDown list and
I am working on creating website with Yii framework and I have a problem
I am creating a website for teaching some arabic words. I am including numbers,
I am creating a website and am facing the following problem. I have 2
When I use the Data-List object in Visual Studio 2008 while creating a website,
I am having some trouble creating a experimental 'dynamic' style website. The site is
I have a problem making a select tag in php code dynamic. I'm creating
A website I'm creating lets users have a unique subdomain on the site eg;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.