Scrapping PHP and jQuery Ajax for AngularJS - BeginnersHow can I prevent SQL injection in PHP?Deleting an element from an array in PHPReference — What does this symbol mean in PHP?jQuery Ajax POST example with PHPHow does data binding work in AngularJS?'this' vs $scope in AngularJS controllersWhy shouldn't I use mysql_* functions in PHP?How do I access the $scope variable in browser's console using AngularJS?“Thinking in AngularJS” if I have a jQuery background?AngularJS: Service vs provider vs factory

Roman Numerals Equation 2

Is it standard to have the first week's pay indefinitely withheld?

Polynomial division: Is this trick obvious?

Why does string strummed with finger sound different from the one strummed with pick?

Non-African Click Languages

When the match time is called, does the current turn end immediately?

Pedaling at different gear ratios on flat terrain: what's the point?

Iterate lines of string variable in bash

When did Britain learn about American independence?

How can I safely determine the output voltage and current of a transformer?

FIFO data structure in pure C

Is Precocious Apprentice enough for Mystic Theurge?

Capital gains on stocks sold to take initial investment off the table

What would a Dragon have to exhale to cause rain?

​Cuban​ ​Primes

How long do Aarakocra live?

How can I make dummy text (like lipsum) grey?

Could a space colony 1g from the sun work?

Why is Drogon so much better in battle than Rhaegal and Viserion?

Divisor Rich and Poor Numbers

Would life always name the light from their sun "white"

What are the effects of eating many berries from the Goodberry spell per day?

Do we see some Unsullied doing this in S08E05?

Working hours and productivity expectations for game artists and programmers



Scrapping PHP and jQuery Ajax for AngularJS - Beginners


How can I prevent SQL injection in PHP?Deleting an element from an array in PHPReference — What does this symbol mean in PHP?jQuery Ajax POST example with PHPHow does data binding work in AngularJS?'this' vs $scope in AngularJS controllersWhy shouldn't I use mysql_* functions in PHP?How do I access the $scope variable in browser's console using AngularJS?“Thinking in AngularJS” if I have a jQuery background?AngularJS: Service vs provider vs factory






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















For years, I have designed functioning web applications using PHP and jQuery. With technology having moved on substantially this approach is inefficient, slow and prone to errors.



In getting started with Angular I would first like to understand if it is capable of effectively replacing where php echo would have been used in the past.



Imagine an HTML div. The text contained within that div comes from a database, is rendered in php and echo'd into place.



Now imagine that the content needs to change. The page would be reloaded with php rendering the new information.



Angular appears to allow that a variable is placed within the div. Something like:



<div>variable</div>


I would like to know if it is possible to use this method to update content on the fly. The idea would be that a new data object is loaded containing all the variables needed. Say, the language is changed and therefore, all the existing text should be updated to reflect the new language.



  1. Can angular do this?

  2. Is there a simple example that just shows something akin to the process above?

The PHP way



<? 

if($_POST["spanish")
include('spanish_variables.php');

else
include('english_variables.php')


?>

<div class="content">
<h2><? echo $variable_1->heading; ?></h2>
<p><? echo $variable_1->content; ?></p>
</div>









share|improve this question






















  • AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

    – georgeawg
    Mar 23 at 17:32











  • @georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

    – Robin Knight
    Mar 23 at 17:59











  • Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

    – georgeawg
    Mar 23 at 18:05


















0















For years, I have designed functioning web applications using PHP and jQuery. With technology having moved on substantially this approach is inefficient, slow and prone to errors.



In getting started with Angular I would first like to understand if it is capable of effectively replacing where php echo would have been used in the past.



Imagine an HTML div. The text contained within that div comes from a database, is rendered in php and echo'd into place.



Now imagine that the content needs to change. The page would be reloaded with php rendering the new information.



Angular appears to allow that a variable is placed within the div. Something like:



<div>variable</div>


I would like to know if it is possible to use this method to update content on the fly. The idea would be that a new data object is loaded containing all the variables needed. Say, the language is changed and therefore, all the existing text should be updated to reflect the new language.



  1. Can angular do this?

  2. Is there a simple example that just shows something akin to the process above?

The PHP way



<? 

if($_POST["spanish")
include('spanish_variables.php');

else
include('english_variables.php')


?>

<div class="content">
<h2><? echo $variable_1->heading; ?></h2>
<p><? echo $variable_1->content; ?></p>
</div>









share|improve this question






















  • AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

    – georgeawg
    Mar 23 at 17:32











  • @georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

    – Robin Knight
    Mar 23 at 17:59











  • Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

    – georgeawg
    Mar 23 at 18:05














0












0








0








For years, I have designed functioning web applications using PHP and jQuery. With technology having moved on substantially this approach is inefficient, slow and prone to errors.



In getting started with Angular I would first like to understand if it is capable of effectively replacing where php echo would have been used in the past.



Imagine an HTML div. The text contained within that div comes from a database, is rendered in php and echo'd into place.



Now imagine that the content needs to change. The page would be reloaded with php rendering the new information.



Angular appears to allow that a variable is placed within the div. Something like:



<div>variable</div>


I would like to know if it is possible to use this method to update content on the fly. The idea would be that a new data object is loaded containing all the variables needed. Say, the language is changed and therefore, all the existing text should be updated to reflect the new language.



  1. Can angular do this?

  2. Is there a simple example that just shows something akin to the process above?

The PHP way



<? 

if($_POST["spanish")
include('spanish_variables.php');

else
include('english_variables.php')


?>

<div class="content">
<h2><? echo $variable_1->heading; ?></h2>
<p><? echo $variable_1->content; ?></p>
</div>









share|improve this question














For years, I have designed functioning web applications using PHP and jQuery. With technology having moved on substantially this approach is inefficient, slow and prone to errors.



In getting started with Angular I would first like to understand if it is capable of effectively replacing where php echo would have been used in the past.



Imagine an HTML div. The text contained within that div comes from a database, is rendered in php and echo'd into place.



Now imagine that the content needs to change. The page would be reloaded with php rendering the new information.



Angular appears to allow that a variable is placed within the div. Something like:



<div>variable</div>


I would like to know if it is possible to use this method to update content on the fly. The idea would be that a new data object is loaded containing all the variables needed. Say, the language is changed and therefore, all the existing text should be updated to reflect the new language.



  1. Can angular do this?

  2. Is there a simple example that just shows something akin to the process above?

The PHP way



<? 

if($_POST["spanish")
include('spanish_variables.php');

else
include('english_variables.php')


?>

<div class="content">
<h2><? echo $variable_1->heading; ?></h2>
<p><? echo $variable_1->content; ?></p>
</div>






php angularjs variables






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 23 at 16:04









Robin KnightRobin Knight

7,66232104175




7,66232104175












  • AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

    – georgeawg
    Mar 23 at 17:32











  • @georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

    – Robin Knight
    Mar 23 at 17:59











  • Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

    – georgeawg
    Mar 23 at 18:05


















  • AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

    – georgeawg
    Mar 23 at 17:32











  • @georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

    – Robin Knight
    Mar 23 at 17:59











  • Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

    – georgeawg
    Mar 23 at 18:05

















AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

– georgeawg
Mar 23 at 17:32





AngularJS applications generally POST json data and receive json data as a response. The role of forms in client-side AngularJS applications is different than in classical roundtrip apps. For more information, see AngularJS <form> Directive API Reference - Submitting a form and preventing the default action.

– georgeawg
Mar 23 at 17:32













@georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

– Robin Knight
Mar 23 at 17:59





@georgeawg I have been reviewing the docs. It seems most straightforward. I presume that if additional content was required (spanish variables) it would be loaded in via Ajax and that that is just about all there is to it? docs.angularjs.org/tutorial

– Robin Knight
Mar 23 at 17:59













Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

– georgeawg
Mar 23 at 18:05






Yes. Avoid using jQuery ajax; instead use the $http service. AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc.

– georgeawg
Mar 23 at 18:05













0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315668%2fscrapping-php-and-jquery-ajax-for-angularjs-beginners%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315668%2fscrapping-php-and-jquery-ajax-for-angularjs-beginners%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript