ClearBlade integration for AngularJS 3
This is an ipm package, which contains one or more reusable assets within the ipm Community. The 'package.json' in this repo is a ipm spec's package.json, here, which is a superset of npm's package.json spec, here.
- Add to AngularJS dependencies
'use strict';
// Declare app level module which depends on views, and components
angular.module('ClearBladeApp', ['ClearBladeController']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.otherwise({redirectTo: '/view1'});
}]);
- Run
npm start
ClearBlade Service
Kind: global variable
Execute a code service within the Cloud Platform
Kind: static method of ClearBlade
Param | Type | Description |
---|---|---|
funcName | string |
Code Service Name to run |
params | Object |
params object to be ingested by Code Service |
retryCounter | number |
number of times to retry executing a code service |
Initialize ClearBlade Service
Kind: static method of ClearBlade
Param | Type | Description |
---|---|---|
string |
ClearBlade System's User Email | |
password | string |
ClearBlade System's User's Password |
$scope.logins = [{ User: {name : 'Rohan'}, Age: 20 }, { User: {name : 'John'}, Age: 18 } ];
var promise = cb.init('test@clearblade.com','rohanbendre');
promise.then(function(resp) {
$scope.response = resp;
});
$scope.sendRequest = function() {
var promise = cb.runCode('ServicePart4','' , 2);
promise.then(function(resp) {
$scope.result = resp;
}, function(reason) {
$scope.result = reason;
});
};
Powered by ClearBlade Enterprise IoT Platform: https://platform.clearblade.com
-
Then start server by doing npm start.
-
SampleCode folder has clearblades angular service and example html/controller files.