I'm having trouble with the code snippet from the blog announcement on the Angular library (http://www.kinvey.com/blog/3541/kinvey-javascript-library-now-available-for-angularjs-web-apps).
The code I am using is:
The error is:
Method not implemented: Kinvey.Persistence.Net.encode
The response can be `null`, that’s perfectly valid and will occur when you are not logged in. You might also want to add a second callback to catch init failures:
```
$kinvey.init(...).then(function(response) {
// success.
angular.bootstrap(...);
}, function(error) {
// error.
});
```
D
Dave Ackerman
said
almost 5 years ago
Hi Mark.
The code you posted doesn't work for me either. I'm using the code you posted below, with a simple "app.js" that looks like this:
```
angular.module('MyApp')
.run(function ($kinvey) {
// $rootScope.build = '1.2';
console.log('i ran');
})
```
```
var jelly = angular.module('MyApp', ['kinvey']);
var $injector = angular.injector(['ng', 'kinvey']);
$injector.invoke(function($kinvey) {
$kinvey.init({
appKey : 'kid_TVxvWekpKi',
appSecret : '051f45d70e964e3a8a0cef8a9389e704'
}).then(function(response) {
console.log(response);
angular.bootstrap(document, ['MyApp']);
});
});
```
I get the "i ran", but the response from kinvey in the bootstrap is null.
M
Mark
said
about 5 years ago
Yes, I am able to reproduce, this is a bug. The code below will work correctly:
```
var myApp = angular.module('MyApp', ['kinvey']);
var $injector = angular.injector(['ng', 'kinvey']);
Paul M
I'm having trouble with the code snippet from the blog announcement on the Angular library (http://www.kinvey.com/blog/3541/kinvey-javascript-library-now-available-for-angularjs-web-apps).
The code I am using is:
The error is:
Method not implemented: Kinvey.Persistence.Net.encode
Any ideas?
Thanks
Paul