{"id":16331,"date":"2017-03-01T12:15:40","date_gmt":"2017-03-01T10:15:40","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=16331"},"modified":"2017-02-28T15:16:01","modified_gmt":"2017-02-28T13:16:01","slug":"learning-angular-c-r-u-d","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/","title":{"rendered":"Learning Angular C.R.U.D."},"content":{"rendered":"<p>So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start?<\/p>\n<p>There are quite a few examples out there. One of the best ideas I have personally found useful for a new developer to learn is how to do Create, Read, Update and Delete operations.<\/p>\n<p>So let\u2019s start learning how to do C.R.U.D. with Angular. In this blog we\u2019ll go through the process of building a simple, working Angular address book application with C.R.U.D. operations. By the end, and by studying the full, working code, you should have a better grasp on Angular.<\/p>\n<h2>Let\u2019s Get Started<\/h2>\n<p>We\u2019re going to build a simple AngularJS 1.x address book application that looks like this:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517.png\"><img decoding=\"async\" class=\"aligncenter wp-image-16333\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517.png\" width=\"860\" height=\"308\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517.png 1157w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517-300x108.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517-768x275.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/LearningC.R.U.D.10517-1024x367.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><br \/>\nFirst what we will need is our HTML template. Remember, we\u2019re going simple here, so in the end we are only going to have two files.<\/p>\n<p>Look through the following markup and I will explain as we go.<\/p>\n<h3>The Markup<\/h3>\n<pre class=\"brush:xml\">&lt;!DOCTYPE html&gt;\r\n&lt;html ng-app=\"example\"&gt;\r\n\r\n&lt;head&gt;\r\n  &lt;meta charset=\"utf-8\" \/&gt;\r\n  &lt;title&gt;AngularJS CRUD Example&lt;\/title&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/4.0.0-alpha.4\/css\/bootstrap.min.css\" \/&gt;\r\n  &lt;script&gt;\r\n    document.write('&lt;base href=\"' + document.location + '\" \/&gt;');\r\n  &lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/code.angularjs.org\/1.5.8\/angular.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"app.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body ng-controller=\"MainCtrl as main\"&gt;\r\n  &lt;div class=\"container\"&gt;\r\n    &lt;h3&gt;Address Book&lt;\/h3&gt;\r\n\r\n    &lt;p&gt;\r\n      &lt;label&gt;First Name&lt;\/label&gt;\r\n      &lt;input type=\"text\" ng-model=\"main.person.firstname \" \/&gt;\r\n      &lt;label&gt;Last Name&lt;\/label&gt;\r\n      &lt;input type=\"text \" ng-model=\"main.person.lastname\" \/&gt;\r\n      &lt;label&gt;City&lt;\/label&gt;\r\n      &lt;input type=\"text\" ng-model=\"main.person.city \" \/&gt;\r\n    &lt;\/p&gt;\r\n\r\n    &lt;div class=\"row\"&gt;\r\n      &lt;div class=\"col-md-7\"&gt;\r\n        &lt;button class=\"btn btn-primary\" ng-click=\"main.addClickHandler()\"&gt;Save&lt;\/button&gt;\r\n        &lt;button class=\"btn btn-default\" ng-click=\"main.resetClickHandler()\"&gt;Clear Form&lt;\/button&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class=\"col-md-5\"&gt;\r\n        &lt;label&gt;Search:&lt;\/label&gt;\r\n        &lt;input type=\"text\" ng-model=\"main.search\" \/&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    \r\n    &lt;p&gt;&lt;\/p&gt;\r\n\r\n    &lt;div class=\"row\" ng-show=\"main.addresses\"&gt;\r\n      &lt;table class=\"table table-bordered table-striped table-condensed\"&gt;\r\n        &lt;thead&gt;\r\n          &lt;tr&gt;\r\n            &lt;th&gt;First Name&lt;\/th&gt;\r\n            &lt;th&gt;Last Name&lt;\/th&gt;\r\n            &lt;th&gt;City&lt;\/th&gt;\r\n            &lt;th&gt;actions&lt;\/th&gt;\r\n          &lt;\/tr&gt;\r\n        &lt;\/thead&gt;\r\n        &lt;tbody&gt;\r\n          &lt;tr ng-repeat=\"item in main.addresses |filter:main.search \"&gt;\r\n            &lt;td ng-bind=\"item.firstname \"&gt;&lt;\/td&gt;\r\n            &lt;td ng-bind=\"item.lastname \"&gt;&lt;\/td&gt;\r\n            &lt;td ng-bind=\"item.city \"&gt;&lt;\/td&gt;\r\n            &lt;td&gt;\r\n              &lt;button class=\"btn btn-primary\" ng-click=\"main.editClickHandler(item)\"&gt;Edit&lt;\/button&gt;\r\n              &lt;button class=\"btn btn-danger\" ng-click=\"main.removeClickHandler(item)\"&gt;Remove&lt;\/button&gt;\r\n            &lt;\/td&gt;\r\n          &lt;\/tr&gt;\r\n        &lt;\/tbody&gt;\r\n      &lt;\/table&gt;\r\n    &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/pre>\n<p>To begin with, we\u2019re adding the bootstrap CSS to make the application look pretty.<\/p>\n<p>Second we\u2019re adding AngularJS 1.5.x to the application from a Content Delivery Network or CDN.<\/p>\n<p>Third we\u2019re making a reference to the JavaScript file which we will be creating and adding our logic to.<\/p>\n<p>On the HTML tag we added <code>ng-app=\"example\"<\/code>. This is making the entire page scoped to our application. On the body tag we add <code>ng-controller=\"MainCtrl as main\"<\/code>. By using the <code>controller as<\/code> syntax we will be avoiding the use of <code>$scope<\/code> throughout the JavaScript.<\/p>\n<p>Now we can get inside the actual meat of the template. For the form where you\u2019ll be adding a name and city we have the following:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-27-at-11.38.16-AM.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-16334\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-27-at-11.38.16-AM.png\" alt=\"\" width=\"716\" height=\"113\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-27-at-11.38.16-AM.png 716w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/02\/Screen-Shot-2017-02-27-at-11.38.16-AM-300x47.png 300w\" sizes=\"(max-width: 716px) 100vw, 716px\" \/><\/a><\/p>\n<p>Notice the usage of <code>main<\/code>. By doing this, we have named the scope of the backing controller. This gives a developer a little more idea of where and what the context of the variable they\u2019re working with.<\/p>\n<p>A second best practice that we\u2019re doing here is using the object <code>person<\/code> to capture the variable of first name, last name, and city. When used with <code>ng-model<\/code>, this is allowing us to set a property on a model rather setting a property on a <code>$scope<\/code>. It\u2019s a much cleaner way of identifying properties when you\u2019re working with them in the JavaScript side of an Angular application.<\/p>\n<p>You will notice that we have written our buttons in this fashion:<\/p>\n<pre class=\"brush:xml\">&lt;button class=\"btn btn-primary\" ng-click=\"main.addClickHandler()\"&gt;Save&lt;\/button&gt;\r\n&lt;button class=\"btn btn-default\" ng-click=\"main.resetClickHandler()\"&gt;Clear Form&lt;\/button&gt;<\/pre>\n<p>Once again, we\u2019re making sure that our alias <code>main<\/code> is attached to the function which we are going to call from the JavaScript side of the application.<\/p>\n<p>With this application we\u2019re also going to take advantage of Angular\u2019s filtering so that we will be able to search through our list of people.<\/p>\n<pre class=\"brush:xml\">&lt;label&gt;Search:&lt;\/label&gt;\r\n&lt;input type=\"text\" ng-model=\"main.search\" \/&gt;<\/pre>\n<p>Now we don\u2019t want an empty table to show before we have people added, so with the following code:<\/p>\n<pre class=\"brush:xml\">&lt;div class=\"row\" ng-show=\"main.addresses\"&gt;<\/pre>\n<p>We are going to hide the display until we have at least one address. <code>ng-show<\/code> works on a boolean toggle. So until we have addresses, the toggle will see false; once we have an address, collection the toggle will see true.<\/p>\n<p>Onto the table which will display the people we are adding:<\/p>\n<pre class=\"brush:xml\">&lt;tr ng-repeat=\"item in main.addresses |filter:main.search \"&gt;<\/pre>\n<p>Simply doing a repeat on the <code>main.address<\/code> collection. We are going to pipe in an Angular filter using the variable we defined earlier: <code>main.search<\/code>.<\/p>\n<p>What\u2019s going to happen here is that anything we type in the input will be used as a filter against the <code>main.address<\/code> collection. We will see an immediate effect on the display when the application is running.<\/p>\n<p>The bindings for the columns are done in this fashion:<\/p>\n<pre class=\"brush:xml\">&lt;td ng-bind=\"item.firstname \"&gt;&lt;\/td&gt;\r\n&lt;td ng-bind=\"item.lastname \"&gt;&lt;\/td&gt;\r\n&lt;td ng-bind=\"item.city \"&gt;&lt;\/td&gt;<\/pre>\n<p><code>item<\/code> is a single item from the collection and by using the dot notation again, we are able to access the properties of that row item.<\/p>\n<p>Last thing in the markup, we are going to have a couple of buttons for each row where we can edit or delete the item.<\/p>\n<pre class=\"brush:xml\">&lt;button class=\"btn btn-primary\" ng-click=\"main.editClickHandler(item)\"&gt;Edit&lt;\/button&gt;\r\n &lt;button class=\"btn btn-danger\" ng-click=\"main.removeClickHandler(item)\"&gt;Remove&lt;\/button&gt;<\/pre>\n<p>These buttons will be pretty much like the first two, except here we are passing the <code>item<\/code> which is associated with that row. This is how we will access that item in the JavaScript.<\/p>\n<p>Okay, we\u2019re done with the markup. Now let\u2019s move on to writing some JavaScript.<\/p>\n<h3>The JavaScript<\/h3>\n<p>The first thing we\u2019re going to do is make an Angular module.<\/p>\n<pre class=\"brush:java\">(function () {\r\n  'use strict'\r\n  angular.module('example', []);\r\n})();<\/pre>\n<p>We\u2019ve introduced an <code>Immediately Invoked Function Expression<\/code> to modularize this application and to keep our code from living on the global namespace.<\/p>\n<p>Once again, it\u2019s best practice syntax. Inside we have created our Angular module and we\u2019ve given it a name. We won\u2019t be using any third-party modules, so nothing else will be done here.<\/p>\n<p>For the rest of the application we\u2019re again going to create an IIFE-wrapped Angular module:<\/p>\n<pre class=\"brush:java\">(function(){\r\n    'use strict';\r\n\r\n    angular\r\n        .module('example')\r\n        .controller(\u2018MainCtrl\u2019, CoreFunction) \r\n    \r\n\r\n}());<\/pre>\n<p>Notice we named the module the same as opening module. We named the controller same as we named it on the HTML template side, and we have passed in a variable named <code>CoreFunction<\/code>.<\/p>\n<p>This <code>variable<\/code> is as it\u2019s called, the core of the controller and all of our logic from this point on will go inside of this function. By doing this we\u2019re giving ourselves the idea of a standalone \u201cclass\u201d which will be passed into the Angular module system. When you see it all together, it feels much more like JavaScript than Angular syntax.<\/p>\n<pre class=\"brush:java\">function CoreFunction() {\r\nvar vm = this,\r\n      \t\taddressCollection = [],\r\n      \t\tisEditing = false;\r\n }<\/pre>\n<p>We create the function and inside of it we instantiate a couple of local variables. The most important one is that we\u2019re going to alias <code>this<\/code> to the abbreviation of <code>vm<\/code>. Functionally there is no reason do this, but by doing this, you have a really good idea of what will be attached to the view via the magic of Angular.<\/p>\n<p>Think of <code>vm<\/code> as view model and think that anything attached to <code>vm<\/code> will be accessible in the template. It makes the mental model of the application a little easier to understand.<\/p>\n<p>After setting <code>vm<\/code>, we\u2019re creating an empty array to hold the addresses locally, and we set an editing flag to be used later in the code.<\/p>\n<p>Again, inside the <code>CoreFunction<\/code>, we\u2019re going to create the actual logic for our Create, Read, Update, and Delete operations.<br \/>\nCreate Operation<\/p>\n<pre class=\"brush:js\">var add = function () {\r\n        var newPerson = {};\r\n\r\n        if (!angular.equals({}, vm.person)) {\r\n          if (isEditing !== false) {\r\n            addressCollection[isEditing] = vm.person;\r\n            isEditing = false;\r\n          } else {\r\n            newPerson = vm.person\r\n            addressCollection.push(newPerson);\r\n          }\r\n\r\n          vm.addresses = addressCollection;\r\n          vm.person = {};\r\n        }\r\n      },<\/pre>\n<p>The <code>add<\/code> function does two things. One, if it\u2019s a new person we will take the properties from <code>vm.person<\/code> which came from the template and push that object in the local address collection. The address collection is assigned to the view model\u2019s collection.<\/p>\n<p>Second, if the <code>add<\/code> function is doing an update, <code>isEditing<\/code> will not be false, and will be used as the index of that person we\u2019re editing. We will replace that existing index with our edited person. Whereupon we reset the editing flag and exit the function.<\/p>\n<h3>Update Operation<\/h3>\n<pre class=\"brush:java\">edit = function (editPerson) {\r\n        isEditing = addressCollection.indexOf(editPerson);\r\n        vm.person = angular.copy(editPerson);\r\n      },<\/pre>\n<p>As we saw in the add, we\u2019re needing to set the <code>isEditing<\/code> flag to something other than false.<\/p>\n<p>Here we\u2019re accepting the person from the template via a function parameter. We\u2019re using JavaScript\u2019s <code>indexOf<\/code> function and we\u2019re going to set <code>isEditing<\/code> to that index number.<\/p>\n<p>Second, we\u2019re setting the view model\u2019s <code>person<\/code> object to a copy of the row\u2019s person object using a built-in Angular copy function. By doing this you will not see the row properties change as you edit them in the input boxes on the template.<\/p>\n<h3>Delete Operation<\/h3>\n<pre class=\"brush:js\">remove = function (removePerson) {\r\n        var index = addressCollection.indexOf(removePerson);\r\n        addressCollection.splice(index, 1);\r\n        if (addressCollection.length === 0) {\r\n          vm.person = {};\r\n          vm.addresses = undefined;\r\n        }\r\n      },<\/pre>\n<p>Deleting a row from our address collection is pretty straightforward. Again, we\u2019re taking the person we want to remove and we\u2019re going to again find its array index. This is just like we did for edit.<\/p>\n<p>Now this time we are going to use another JavaScript function called <code>splice<\/code> to cut out and remove that index from our collection.<\/p>\n<p>Now if we removed the last person from the address collection, we want to clean up the view model so <code>wm.person<\/code> is initialized as an empty object and <code>wm.address<\/code> is set as undefined.<\/p>\n<p>Why undefined you may ask? Instead of setting the collection to an empty array, which will still have a length, we want to set the variable to something that will be a JavaScript-falsey value. Remember the boolean toggle on the template. Yes, that\u2019s where this value is set to hide the table.<\/p>\n<h3>But Where Is The Read Operation?<\/h3>\n<p>You may be wondering why there\u2019s no function to \u201cread\u201d the data. Well if you look again at the <code>add<\/code> function, you\u2019ll notice that when you do \u201cadd\u201d a person you\u2019re pushing an item in the address collection which is bound to the <code>vm.addresses<\/code>.<\/p>\n<p>Remember when I said that anything attached to the view model will be accessible in the template, well we have a <code>ng-repeat<\/code> which will actually \u201cread\u201d that collection and generate the rows for us.<\/p>\n<p>So in essence, \u201cread\u201d is the only operation where we don\u2019t have to actually do much to make it work.<\/p>\n<h3>The Rest Of The Code<\/h3>\n<p>The rest of the JavaScript is actually pretty simple:<\/p>\n<pre class=\"brush:java\">reset = function () {\r\n        vm.person = {};\r\n        vm.search = '';\r\n        isEditing = false;\r\n      }\r\n\r\n    \/\/ view model attached click handlers\r\n    vm.addClickHandler = function () {\r\n      add();\r\n    }\r\n\r\n    vm.editClickHandler = function (editPerson) {\r\n      edit(editPerson);\r\n    }\r\n\r\n    vm.removeClickHandler = function (removePerson) {\r\n      remove(removePerson);\r\n    }\r\n\r\n    vm.resetClickHandler = function () {\r\n      reset();\r\n    }<\/pre>\n<p>Again, all of this code resides in the <code>CoreFunction<\/code>. The <code>reset<\/code> function is a cleanup function where all of our working creating and editing items are set back to a default state. This does not clear the address collection, just the form found in the HTML template.<\/p>\n<p>Now the last four functions are attached to the view model <code>vm<\/code> and are used as our click handlers for the buttons found in the HTML template. Notice that inside of each click handler, we are just going to call the local function and pass on any parameters are necessary.<\/p>\n<h2>Summary<\/h2>\n<p>So after all that hard work you should now have a working Angular 1.x application which allows you to Create, Read, Update and Delete operations from a locally-created collection.<\/p>\n<p>You can see <a href=\"https:\/\/plnkr.co\/edit\/SHBljy\" target=\"_blank\">working example on Plnkr.co<\/a>.<\/p>\n<p>I hope that you found this helpful in getting to know Angular!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/keyholesoftware.com\/2017\/02\/27\/learning-angular-crud\/\">Learning Angular C.R.U.D.<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a>\u00a0Chris Berry\u00a0at the <a href=\"http:\/\/keyholesoftware.com\/\">Keyhole Software<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the best ideas I have personally found useful for a new developer to learn is how to do Create, Read, Update and Delete operations. So let\u2019s start learning &hellip;<\/p>\n","protected":false},"author":152,"featured_media":909,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-16331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angular-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Learning Angular C.R.U.D. - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the\" \/>\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.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learning Angular C.R.U.D. - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-03-01T10:15:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chris Berry\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chris Berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\"},\"author\":{\"name\":\"Chris Berry\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ccc4ed8f5b57822a38890b90b3933432\"},\"headline\":\"Learning Angular C.R.U.D.\",\"datePublished\":\"2017-03-01T10:15:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\"},\"wordCount\":1627,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"articleSection\":[\"Angular.js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\",\"name\":\"Learning Angular C.R.U.D. - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"datePublished\":\"2017-03-01T10:15:40+00:00\",\"description\":\"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Angular.js\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Learning Angular C.R.U.D.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ccc4ed8f5b57822a38890b90b3933432\",\"name\":\"Chris Berry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/efe294b70d517ef4fded0fb5a107eff40750199a5536277a5b4ec8795346f14a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/efe294b70d517ef4fded0fb5a107eff40750199a5536277a5b4ec8795346f14a?s=96&d=mm&r=g\",\"caption\":\"Chris Berry\"},\"description\":\"Chris is a Consultant at Keyhole with a focus on .NET and JavaScript technologies. He likes to dive in and look at the architecture of an application to learn how all of the moving pieces are handled. In the end, he loves to pass along what he's learned and to help people make some good design choices for all aspects of a project.\",\"url\":\"https:\/\/www.webcodegeeks.com\/author\/chris-berry\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learning Angular C.R.U.D. - Web Code Geeks - 2026","description":"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the","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.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/","og_locale":"en_US","og_type":"article","og_title":"Learning Angular C.R.U.D. - Web Code Geeks - 2026","og_description":"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-03-01T10:15:40+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","type":"image\/jpeg"}],"author":"Chris Berry","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Chris Berry","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/"},"author":{"name":"Chris Berry","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ccc4ed8f5b57822a38890b90b3933432"},"headline":"Learning Angular C.R.U.D.","datePublished":"2017-03-01T10:15:40+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/"},"wordCount":1627,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","articleSection":["Angular.js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/","name":"Learning Angular C.R.U.D. - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","datePublished":"2017-03-01T10:15:40+00:00","description":"So, you\u2019ve learned JavaScript and now you\u2019re wanting to get into Angular. But where do you start? There are quite a few examples out there. One of the","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/angularjs-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/angular-js\/learning-angular-c-r-u-d\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Angular.js","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/angular-js\/"},{"@type":"ListItem","position":4,"name":"Learning Angular C.R.U.D."}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/ccc4ed8f5b57822a38890b90b3933432","name":"Chris Berry","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/efe294b70d517ef4fded0fb5a107eff40750199a5536277a5b4ec8795346f14a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/efe294b70d517ef4fded0fb5a107eff40750199a5536277a5b4ec8795346f14a?s=96&d=mm&r=g","caption":"Chris Berry"},"description":"Chris is a Consultant at Keyhole with a focus on .NET and JavaScript technologies. He likes to dive in and look at the architecture of an application to learn how all of the moving pieces are handled. In the end, he loves to pass along what he's learned and to help people make some good design choices for all aspects of a project.","url":"https:\/\/www.webcodegeeks.com\/author\/chris-berry\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/16331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/152"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=16331"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/16331\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/909"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=16331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=16331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=16331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}