Update creating_module.md

replaced $scope.text with $scope.hello
Line 87, 100, 104
This commit is contained in:
Harry Chilinguerian 2017-01-13 12:22:54 -05:00 committed by GitHub
parent 50741b89c6
commit 75abf42df7

View File

@ -84,7 +84,7 @@ Here we register the name of the controller, `"ExampleController"`. Then we incl
Now we will add a variable inside our scope called `hello`, like so: Now we will add a variable inside our scope called `hello`, like so:
``` ```
registerController("ExampleController", ['$api', '$scope', function($api, $scope) { registerController("ExampleController", ['$api', '$scope', function($api, $scope) {
$scope.text = "Hello World!"; $scope.hello = "Hello World!";
}]) }])
``` ```
@ -97,11 +97,11 @@ registerController("ExampleController", ['$api', '$scope', function($api, $scope
module: 'ExampleModule', module: 'ExampleModule',
action: 'getHello' action: 'getHello'
}, function(response) { }, function(response) {
$scope.text = response.text; $scope.hello = response.text;
}); });
}]) }])
``` ```
This will send a request to our module.php, and take its response and set `$scope.text` to `response.text`. This will send a request to our module.php, and take its response and set `$scope.hello` to `response.text`.
#### module.php #### module.php
The module.php contains all PHP code and can directly interface with other modules, talk to the Javascript and access the WiFi Pineapple API. In this guide, we will finish our Example Module by making it reply to our AngularJS request and return a string containing "Hello World!". The module.php contains all PHP code and can directly interface with other modules, talk to the Javascript and access the WiFi Pineapple API. In this guide, we will finish our Example Module by making it reply to our AngularJS request and return a string containing "Hello World!".