{"id":479,"date":"2015-12-16T01:03:52","date_gmt":"2015-12-16T01:03:51","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/"},"modified":"2015-12-16T01:03:52","modified_gmt":"2015-12-16T01:03:51","slug":"using-couchbase-in-your-ionic-framework-application-part-2","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/using-couchbase-in-your-ionic-framework-application-part-2\/","title":{"rendered":"Using Couchbase in Your Ionic Framework Application Part 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Previously in <a href=\"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-1\/\">part one of this series<\/a><br>\nregarding Ionic Framework and Couchbase, I wrote about using Couchbase Lite to do local CRUD<br>\n(Create, Retrieve, Update, Delete) operations in a todo list example. This time around we&#8217;re going to take it to the next level and see<br>\nhow to replicate changes across multiple devices and platforms using the Couchbase Sync Gateway.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to be successful in this tutorial, you need to have done the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Completed part one of the Ionic Framework blog series<\/li>\n\n\n<li>Downloaded the Couchbase Sync Gateway<\/li>\n\n\n<li>The Android SDK if building for Android<\/li>\n\n\n<li>A Mac with Xcode installed if building for iOS<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This tutorial is going to pick up exactly where part one of the series left off, so it is important that you had the first part in a working<br>\nstate before continuing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Couchbase Sync Gateway<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In order to use Sync Gateway with our application we first need to create a configuration file. Create a file called<br>\n<strong>sync-gateway-config.json<\/strong> at the root of your project and include the following:<\/p>\n\n\n<p>[crayon lang=&#8221;json&#8221;]<br \/>\n{<br \/>\n    &#8220;log&#8221;: [&#8220;CRUD&#8221;, &#8220;REST+&#8221;, &#8220;Access&#8221;],<br \/>\n    &#8220;databases&#8221;: {<br \/>\n        &#8220;todos&#8221;: {<br \/>\n            &#8220;server&#8221;: &#8220;walrus:&#8221;,<br \/>\n            &#8220;users&#8221;: {<br \/>\n                &#8220;GUEST&#8221;: {&#8220;disabled&#8221;: false, &#8220;admin_channels&#8221;: [&#8220;*&#8221;]}<br \/>\n            },<br \/>\n            &#8220;sync&#8221;: `<br \/>\n                function(doc, oldDoc) {<br \/>\n                    \/\/ NOTE this function is the same across the iOS, Android, and PhoneGap versions.<br \/>\n                    if (doc.type == &#8220;task&#8221;) {<br \/>\n                        if (!doc.list_id) {<br \/>\n                            throw({forbidden : &#8220;items must have a list_id&#8221;})<br \/>\n                        }<br \/>\n                        channel(&#8220;task-&#8220;+doc.list_id);<br \/>\n                    } else if (doc.type == &#8220;list&#8221;) {<br \/>\n                        channel(&#8220;list-&#8220;+doc._id);<br \/>\n                        if (!doc.owner) {<br \/>\n                            throw({forbidden : &#8220;list must have an owner&#8221;})<br \/>\n                        }<br \/>\n                        if (oldDoc) {<br \/>\n                            var oldOwnerName = oldDoc.owner.substring(oldDoc.owner.indexOf(&#8220;:&#8221;)+1);<br \/>\n                            requireUser(oldOwnerName)<br \/>\n                        }<br \/>\n                        var ownerName = doc.owner.substring(doc.owner.indexOf(&#8220;:&#8221;)+1);<br \/>\n                        access(ownerName, &#8220;list-&#8220;+doc._id);<br \/>\n                    }<br \/>\n                }<br \/>\n            `<br \/>\n        }<br \/>\n    }<br \/>\n}<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t let the above overwhelm you as there isn&#8217;t too much going on. Most of the logic just checks to make sure documents have all the<br>\nrequired properties.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To highlight some of the main things happening here, first take a look at the <strong>databases.todos<\/strong> property.<br>\nThis is going to be our remote database. The server we&#8217;re using is <strong>walrus<\/strong> which is a memory based solution bundled<br>\ninto the Sync Gateway. It is good for testing before you&#8217;re ready to have it save into Couchbase Server. We are also choosing to enable<br>\nguest access, so registered users won&#8217;t be required for now.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This brings us into the sync JavaScript code. If the document is of type task, we check to see if a parent list id exists, otherwise we<br>\nforce a fail. If it exists, then we save the document in the Sync Gateway prefixed with <strong>task-<\/strong> in the key. If the document<br>\ntype is not a task, then it might be a list. Check to make sure the document has an <strong>owner<\/strong> property and save it to the<br>\nSync Gateway prefixed with <strong>list-<\/strong> in the key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding a New Ionic Route For Login<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Adding to the AngularJS UI-Router<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As of right now your AngularJS configuration should include two routes. One for the todo lists and one for tasks. What we want to do<br>\nnow is include a third route for signing into the Sync Gateway. Inside your project&#8217;s <strong>www\/js\/app.js<\/strong> file, make the following<br>\nchange:<\/p>\n\n\n<p>[crayon lang=&#8221;javascript&#8221;]<br \/>\ncouchbaseApp.config(function($stateProvider, $urlRouterProvider) {<br \/>\n    $stateProvider<br \/>\n        .state(&#8220;login&#8221;, {<br \/>\n            url: &#8220;\/login&#8221;,<br \/>\n            templateUrl: &#8220;templates\/login.html&#8221;,<br \/>\n            controller: &#8220;LoginController&#8221;<br \/>\n        })<br \/>\n        .state(&#8220;todoLists&#8221;, {<br \/>\n            url: &#8220;\/todoLists&#8221;,<br \/>\n            templateUrl: &#8220;templates\/todolists.html&#8221;,<br \/>\n            controller: &#8220;TodoListsController&#8221;<br \/>\n        })<br \/>\n        .state(&#8220;tasks&#8221;, {<br \/>\n            url: &#8220;\/tasks\/:listId&#8221;,<br \/>\n            templateUrl: &#8220;templates\/tasks.html&#8221;,<br \/>\n            controller: &#8220;TaskController&#8221;<br \/>\n        });<br \/>\n    $urlRouterProvider.otherwise(&#8220;\/login&#8221;);<br \/>\n});<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the new login state and that we changed our default route to be <strong>\/login<\/strong> instead of <strong>\/todoLists<\/strong>. The<br>\nroute is good to go, we just need to create the view and controller to finalize it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating a Login View<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Inside your project&#8217;s <strong>www\/templates<\/strong> directory, create a file called <strong>login.html<\/strong> and add the following code:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><button class=\"button button-block button-balanced\">Guest Login<\/button><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sign in as a guest user<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is just a simple view with a button on it. When the user clicks the button, the <strong>basicLogin()<\/strong> function is called which<br>\nwe&#8217;ll be creating in the login controller.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a Login Controller<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The controller for handling sign-ins will accomplish one very major task. It will start the replication process between the Sync Gateway<br>\nand the local device. Here is slim version of our controller that should be added to the <strong>www\/js\/app.js<\/strong> file:<\/p>\n\n\n<p>[crayon lang=&#8221;javascript&#8221;]<br \/>\ncouchbaseApp.controller(&#8220;LoginController&#8221;, function($scope, $state, $ionicHistory) {<\/p>\n<p>    $ionicHistory.nextViewOptions({<br \/>\n        disableAnimate: true,<br \/>\n        disableBack: true<br \/>\n    });<\/p>\n<p>    $scope.basicLogin = function() { };<\/p>\n<p>});<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice the <strong>$ionicHistory.nextViewOptions<\/strong> method. This is to prevent the hardware back button from taking users back<br>\nto the login screen after they&#8217;ve already logged in. More important for Android since iOS doesn&#8217;t have a hardware back.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next you&#8217;ll see the <strong>$scope.basicLogin()<\/strong> function that was called from the UI view. Its contents will look like the following:<\/p>\n\n\n<p>[crayon lang=&#8221;javascript&#8221;]<br \/>\n$scope.basicLogin = function() {<br \/>\n    todoDatabase.replicate(&#8220;todo&#8221;, &#8220;https:\/\/192.168.56.1:4984\/todos&#8221;, true).then(function(result) {<br \/>\n        todoDatabase.replicate(&#8220;https:\/\/192.168.56.1:4984\/todos&#8221;, &#8220;todo&#8221;, true).then(function(result) {<br \/>\n            $state.go(&#8220;todoLists&#8221;);<br \/>\n        }, function(error) {<br \/>\n            \/\/ There was an error replicating to the local device<br \/>\n        });<br \/>\n    }, function(error) {<br \/>\n        \/\/ There was an error replicating to the Sync Gateway<br \/>\n    });<br \/>\n};<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first thing that happens is replication from the local device to the sync gateway. It is set to continuously replicate all changes. If<br>\nreplication from local to remote starts successfully, the same happens for remote to local. Data will be continuously replicated from<br>\nthe remote Sync Gateway down to the device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If both are successful, the user will be redirected to the todo lists. Note that the Sync Gateway does not need to be operational to move<br>\npast login. If the server is not up, it will fail gracefully and still move on. Also note, that the IPs listed in the above function are<br>\nIPs that allowed me to communicate between simulator to the local host machine. They may differ for you and some research may need to be done.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Owner Information To Document Data<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two minor changes need to be made to the way we store documents in the local database. In the <strong>$scope.insert<\/strong> of both<br>\ntask and todo list controllers, an <strong>owner<\/strong> property must be added. In this case the owner will be <strong>guest<\/strong>.<\/p>\n\n\n<p>[crayon lang=&#8221;javascript&#8221;]<br \/>\n$scope.insert = function() {<br \/>\n    $ionicPopup.prompt({<br \/>\n        title: &#8216;Enter a new TODO list&#8217;,<br \/>\n        inputType: &#8216;text&#8217;<br \/>\n    })<br \/>\n    .then(function(result) {<br \/>\n        var obj = {<br \/>\n            title: result,<br \/>\n            type: &#8220;list&#8221;,<br \/>\n            owner: &#8220;guest&#8221;<br \/>\n        };<br \/>\n        todoDatabase.createDocument(obj).then(function(result) {<br \/>\n            \/\/ Document created successfully<br \/>\n        }, function(error) {<br \/>\n            \/\/ Document creation failed<br \/>\n        });<br \/>\n    });<br \/>\n}<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The above code is an example of one of the <strong>$scope.insert<\/strong> functions. Again the only difference here is that we added an<br>\n<strong>owner<\/strong> property.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing Your Project<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Running the Couchbase Sync Gateway<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With the Sync Gateway downloaded, run the following from your Command Prompt or Terminal:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\n\/path\/to\/sync\/gateway\/bin\/sync_gateway \/path\/to\/project\/sync-gateway-config.json<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Sync Gateway should start without issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testing for Android<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With a device connected or a simulator running, from the Command Prompt or Terminal, run the following two commands to<br>\nbuild and install the APK file:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\nionic build android<br \/>\nadb install -r platforms\/android\/build\/outputs\/apk\/android-debug.apk<br \/>\n[\/crayon]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testing for iOS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There are two good ways to do this. You can either build the project and open it with Xcode, or you can build and emulate the application<br>\nwithout launching Xcode. The first can be done like so:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\nionic build ios<br \/>\n[\/crayon]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then open the project&#8217;s <strong>platform\/ios\/<\/strong> directory and launch the Xcode project file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;ve installed the Node Package Manager (NPM) package <strong>ios-sim<\/strong>, you can do the following:<\/p>\n\n\n<p>[crayon lang=&#8221;bash&#8221;]<br \/>\nionic build ios<br \/>\nionic emulate ios<br \/>\n[\/crayon]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway, we&#8217;ve created a mobile todo list application that replicates data<br>\nlocally and remotely so it can be accessed across multiple devices and platforms. We used AngularJS to easily connect to the RESTful endpoints<br>\nthat Couchbase Lite exposes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This series can be downloaded in full from the <a href=\"https:\/\/github.com\/couchbaselabs\/todolite-ionic\">Couchbase Labs GitHub<\/a> page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Previously in part one of this series regarding Ionic Framework and Couchbase, I wrote about using Couchbase Lite to do local CRUD (Create, Retrieve, Update, Delete) operations in a todo list example. This time around we&#8217;re going to take it to the next level and see how to replicate changes across multiple devices and platforms [&hellip;]<\/p>\n","protected":false},"author":63,"featured_media":18,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_acf":"","footnotes":""},"categories":[159,9],"tags":[160,161,162],"ppma_author":[148],"class_list":["post-479","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-couchbase-mobile","tag-apache-cordova","tag-ionic-framework","tag-ios"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.6 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Using Couchbase in Your Ionic Framework Application Part 2<\/title>\n<meta name=\"description\" content=\"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/using-couchbase-in-your-ionic-framework-application-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Couchbase in Your Ionic Framework Application Part 2\" \/>\n<meta property=\"og:description\" content=\"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/using-couchbase-in-your-ionic-framework-application-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-16T01:03:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1800\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Using Couchbase in Your Ionic Framework Application Part 2\",\"datePublished\":\"2015-12-16T01:03:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/\"},\"wordCount\":1344,\"commentCount\":46,\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"keywords\":[\"apache cordova\",\"ionic framework\",\"ios\"],\"articleSection\":[\"Android\",\"Couchbase Mobile\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/\",\"name\":\"Using Couchbase in Your Ionic Framework Application Part 2\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-12-16T01:03:51+00:00\",\"description\":\"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/05\\\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/using-couchbase-in-your-ionic-framework-application-part-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Couchbase in Your Ionic Framework Application Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"contentUrl\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/5\\\/2026\\\/06\\\/logo.svg\",\"width\":\"1024\",\"height\":\"1024\",\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/#\\\/schema\\\/person\\\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\\\/\\\/www.thepolyglotdeveloper.com\",\"https:\\\/\\\/www.facebook.com\\\/thepolyglotdeveloper\",\"https:\\\/\\\/x.com\\\/nraboy\"],\"url\":\"https:\\\/\\\/www.couchbase.com\\\/blog\\\/ko\\\/author\\\/nic-raboy-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Using Couchbase in Your Ionic Framework Application Part 2","description":"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/using-couchbase-in-your-ionic-framework-application-part-2\/","og_locale":"ko_KR","og_type":"article","og_title":"Using Couchbase in Your Ionic Framework Application Part 2","og_description":"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/using-couchbase-in-your-ionic-framework-application-part-2\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2015-12-16T01:03:51+00:00","og_image":[{"width":1800,"height":630,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","type":"image\/png"}],"author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"6\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Using Couchbase in Your Ionic Framework Application Part 2","datePublished":"2015-12-16T01:03:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/"},"wordCount":1344,"commentCount":46,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","keywords":["apache cordova","ionic framework","ios"],"articleSection":["Android","Couchbase Mobile"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/","url":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/","name":"Using Couchbase in Your Ionic Framework Application Part 2","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","datePublished":"2015-12-16T01:03:51+00:00","description":"This post focuses on how to replicate changes across multiple devices and platforms using the Couchbase PhoneGap plugin and the Couchbase Sync Gateway.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/05\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/using-couchbase-in-your-ionic-framework-application-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using Couchbase in Your Ionic Framework Application Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4, NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/5\/2026\/06\/logo.svg","width":"1024","height":"1024","caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1","name":"\ub2c9 \ub77c\ubcf4\uc774, \uac1c\ubc1c\uc790 \uc560\ub4dc\ubcf4\ucf00\uc774\ud2b8, \uce74\uc6b0\uce58\ubca0\uc774\uc2a4","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"\ub2c9 \ub77c\ubcf4\uc774(Nic Raboy)\ub294 \ubaa8\ub358 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c \uae30\uc220\uc758 \uc639\ud638\uc790\uc785\ub2c8\ub2e4. \uadf8\ub294 \uc790\ubc14, \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8, \uace8\ub791(Golang)\uc744 \ube44\ub86f\ud574 \uc575\uade4\ub7ec, \ub124\uc774\ud2f0\ube0c\uc2a4\ud06c\ub9bd\ud2b8, \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14 \uac19\uc740 \ub2e4\uc591\ud55c \ud504\ub808\uc784\uc6cc\ud06c \uacbd\ud5d8\uc744 \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ub2c9\uc740 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c\uc744 \ub354 \uc27d\uac8c \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \ub3d5\ub294 \uc790\uc2e0\uc758 \uac1c\ubc1c \uacbd\ud5d8\uc5d0 \ub300\ud574 \uae00\uc744 \uc501\ub2c8\ub2e4.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/nic-raboy-2\/"}]}},"acf":[],"authors":[{"term_id":148,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","author_category":"","first_name":"Nic","last_name":"Raboy","user_url":"","job_title":"","description":"\ub2c9 \ub77c\ubcf4\uc774(Nic Raboy)\ub294 \ubaa8\ub358 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c \uae30\uc220\uc758 \uc639\ud638\uc790\uc785\ub2c8\ub2e4. \uadf8\ub294 \uc790\ubc14, \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8, \uace8\ub791(Golang)\uc744 \ube44\ub86f\ud574 \uc575\uade4\ub7ec, \ub124\uc774\ud2f0\ube0c\uc2a4\ud06c\ub9bd\ud2b8, \uc544\ud30c\uce58 \ucf54\ub974\ub3c4\ubc14 \uac19\uc740 \ub2e4\uc591\ud55c \ud504\ub808\uc784\uc6cc\ud06c \uacbd\ud5d8\uc744 \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ub2c9\uc740 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c\uc744 \ub354 \uc27d\uac8c \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \ub3d5\ub294 \uc790\uc2e0\uc758 \uac1c\ubc1c \uacbd\ud5d8\uc5d0 \ub300\ud574 \uae00\uc744 \uc501\ub2c8\ub2e4."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=479"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/479\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/18"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=479"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=479"}],"curies":[{"name":"\uc798\ud588\uc5b4","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}