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

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현