This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| <script> | |
| window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || document.write('<script src="IndexedDBShim.min.js"><\/script>'); | |
| </script> | |
| <script src="//da189i1jfloii.cloudfront.net/js/kinvey-js-0.9.8.min.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // "items" is the collection name. | |
| var Item = Kinvey.Entity.extend({ | |
| constructor: function(attributes) { | |
| Kinvey.Entity.prototype.constructor.call(this, attributes, 'items', { | |
| store: 'offline', | |
| options: { policy: 'cachefirst' } | |
| }); | |
| } | |
| }); | |
| var Items = Kinvey.Collection.extend({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Initialize the Facebook SDK. | |
| FB.init({ | |
| appId: '<your-app-id>', | |
| oauth: true | |
| /* additional properties */ | |
| }); | |
| // Open login popup. | |
| FB.login(function(response) { | |
| if(response.authResponse) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Initialize the Facebook SDK. | |
| FB.init({ | |
| appId: '<your-app-id>', | |
| oauth: true | |
| /* additional properties */ | |
| }); | |
| // Open login popup. | |
| FB.login(function(response) { | |
| if(response.authResponse) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // How to define: | |
| // -------------- | |
| var callableObjectFn = function() { | |
| // Use CallableObject as name in constructor function, but also when setting property below. | |
| var CallableObject = (function(CallableObject) { | |
| return function() { | |
| return CallableObject(); | |
| }; | |
| }(callableObjectFn)); | |
| CallableObject.property = 'value'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="//da189i1jfloii.cloudfront.net/js/kinvey-angular-1.1.4.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html ng-app="MyApp"> | |
| … | |
| <script> | |
| var myApp = angular.module('MyApp', ['kinvey']); | |
| myApp.run(function($kinvey) { | |
| $kinvey.init({ | |
| appKey : 'App Key', | |
| appSecret : 'App Secret' | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| … | |
| <script> | |
| var myApp = angular.module('MyApp', ['kinvey']); | |
| var $injector = angular.injector(['ng', 'kinvey']); | |
| $injector.invoke(['$kinvey', function($kinvey) { | |
| $kinvey.init({ | |
| appKey : 'App Key', | |
| appSecret : 'App Secret' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.controller('DataCtrl', ['$scope', '$kinvey', function($scope, $kinvey) { | |
| $kinvey.DataStore.get('collection-name', 'entity-id').then(function(entity) { | |
| $scope.entity = entity; | |
| $scope.$apply(); | |
| }); | |
| }]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.controller('DataCtrl', ['$scope', '$kinvey', function($scope, $kinvey) { | |
| $kinvey.DataStore.get('collection-name', 'entity-id').then(function(entity) { | |
| $scope.entity = entity; | |
| }); | |
| }]); |