0
How to capture [on a PHP page] the value of input
below using factory
angularjs?
HTML:
<input type="text" name="edicao" ng-model="edicao"
value="<?php if(isset($_GET['edicao'])){echo $_GET['edicao'];}else{}?>" />
Angularjs:
factory.autosave = $resource('actions/autosave.php', {}, {});
try thus Factory.autosave = $Resource('actions/autosave.php', {edit: $Scope.edit}, {}); So it will send a json object in the body of the request that has the attribute "issue" and its value.
– Hugo Lima
Hi @Hugolima, it so happens that the
factory.autosave
is out of thecontroller
. That is to say,$scope is not defined
.– lucasbento
In your controller you must have Factory instantiated, it is in the controller that you send the objects for the request.... Factory.autosave.get({edit: $Scope.edit},{},Function(return){//logic});
– Hugo Lima