<pre><code>
app.controller('InitCtrl',['$scope', function ($scope) {
$scope.register = function () {
var _data = { a: $scope.fReg.id + '[O0@]' + $scope.fReg.loc +
'[O0@]' + $scope.fReg.scode ,b: deviceUniq ,c: deviceParm };
_cL(_data);
$http.post('someurl', _data).then(function () {
},function () {
});
}
}]);
</code></pre>
This code says $http is not defined.
then i did this.
<pre><code>
app.controller('InitCtrl',['$scope','$http', function ($scope,$http) {
$scope.register = function () {
var _data = { a: $scope.fReg.id + '[O0@]' + $scope.fReg.loc +
'[O0@]' + $scope.fReg.scode ,b: deviceUniq ,c: deviceParm };
_cL(_data);
$http.post('someurl', _data).then(function () {
},function () {
});
}
}]);
</code></pre>
This code has not error like the above one, but the value in $scope.fReg
object is undefined. Those are my text fields in form.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.