{"id":14359,"date":"2014-06-29T21:21:45","date_gmt":"2014-06-29T15:51:45","guid":{"rendered":"https:\/\/2thenew.online\/blog\/?p=14359"},"modified":"2017-08-03T16:00:41","modified_gmt":"2017-08-03T10:30:41","slug":"service-in-angularjs","status":"publish","type":"post","link":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/","title":{"rendered":"Service in AngularJS"},"content":{"rendered":"<p>When we are working on <strong>MVC<\/strong> (or <strong>MVVM<\/strong> for <strong>AngularJS<\/strong>) <strong>Design-Patterns<\/strong>, our application is loosely coupled because of different independent components defined for e.g. <strong>Controller<\/strong>, <strong>View<\/strong>, <strong>Services<\/strong>, <strong>Modal\/Data<\/strong> etc. All the components have their own work\/role but today we will discuss only <strong>Services<\/strong>.<\/p>\n<p><strong>Services<\/strong> are that part of application where we write our business logic and load data (if it is frond-end framework Service e.g. <a title=\"Angular Development\" href=\"https:\/\/2thenew.online\/front-end-angularjs-development\">AngularJS Service<\/a> then it loads data from Web Server and if it is back-end framework Service e.g. <strong>NodeJS<\/strong> <strong>Service<\/strong> then it loads data from Database Server or other Web Server). <strong>AngularJS<\/strong> also provides many built-in <strong>services<\/strong> e.g. <strong>$http<\/strong>, <strong>$q<\/strong> etc. <strong>$http<\/strong> is very commonly used <strong>service<\/strong> which helps us to load data from Web Server, we can hit Ajax request with the help of <strong>$http <\/strong><strong>service<\/strong>, which internally hits <strong>XMLHTTPRequest<\/strong>.<\/p>\n<p>Generally, instead of writing <strong>Services<\/strong> we do data loading from Web-Server in <strong>Controllers<\/strong>, which is obviously a bad practice. So lets try a basic program, where we will load data from Web-Server with the help of <strong>Service<\/strong> instead of writing the code into <strong>Controller<\/strong>.<\/p>\n<p>[js]<br \/>\nvar serviceTestApp = angular.module(&#8216;serviceTest&#8217;, []);<\/p>\n<p>\/*<br \/>\n * Defining TestService, Which will load User list Asynchronously(From Web-Server).<br \/>\n * for demo purpose we are using setTimeout().<br \/>\n *<br \/>\n * $q is built-in Angular Service which helps us to implement Promise-Defer Design Pattern and<br \/>\n * will be injected to TestService by AngularJS via DI(Dependency Injection) Design Pattern.<br \/>\n * *\/<br \/>\nserviceTestApp.service(&#8216;TestService&#8217;, function ($q) {<br \/>\n    \/\/ Defining Service function: getUsers which will load user list<br \/>\n    this.getUsers = function () {<br \/>\n        var deferred = $q.defer();<br \/>\n        setTimeout(function () {<br \/>\n            var users = [<br \/>\n                {name: &quot;Amit Thakkar&quot;, age: 25},<br \/>\n                {name: &quot;Namita&quot;, age: 36},<br \/>\n                {name: &quot;Kanika&quot;, age: 43}<br \/>\n            ];<br \/>\n            deferred.resolve(users);<br \/>\n        }, 2000);<br \/>\n        return deferred.promise;<br \/>\n    };<br \/>\n});<br \/>\n[\/js]<\/p>\n<p>Also, <strong>Services<\/strong> must be registered with <strong>module<\/strong>(Same as <strong>directives<\/strong>) via <strong>module.service<\/strong> API, in which first argument is the name of the <strong>Service<\/strong> and second argument is the function. Second argument function is just a constructor function that will be called with <strong>&#8216;new&#8217;<\/strong> keyword by <strong>AngularJS<\/strong> itself. And this <strong>Service<\/strong> will be injected to <strong>Controllers<\/strong> or other <strong>Services<\/strong> (<strong>AngularJS<\/strong> also implement <strong>Dependency Injection<\/strong> Design Pattern to inject <strong>services<\/strong> to <strong>Controllers<\/strong> and <strong>Services<\/strong>).<\/p>\n<p>[js]<br \/>\n\/*<br \/>\n * Defining TestController, who will use TestService to get User List.<br \/>\n * *\/<br \/>\nfunction TestController($scope, TestService) {<br \/>\n    \/\/ Calling getUsers function on TestService.<br \/>\n    TestService.getUsers().<br \/>\n        then(function (users) {<br \/>\n            $scope.users = users;<br \/>\n        });<br \/>\n}<br \/>\n[\/js]<\/p>\n<p><strong>AngularJS<\/strong> <strong>Services<\/strong> implement <strong>Singleton Design Pattern<\/strong> so only one object is created for an application.<\/p>\n<p><strong>NOTE:<\/strong> You can checkout full working source code from this <a href=\"https:\/\/github.com\/AmitThakkar\/AngularDemo\" target=\"_blank\">link<\/a>.<\/p>\n<p><span style=\"font-size: 20px; color: blue;\">Read Further on AngularJS Series<\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-a-write-less-do-more-javascript-framework\/\">AngularJS :\u00a0A \u201cWrite Less Do More\u201d JavaScript Framework<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-updating-a-label-dynamically-with-user-input\/\">AngularJS :\u00a0Updating a Label Dynamically with User Input<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-adding-items-to-a-javascript-list-and-updating-corresponding-dom-dynamically\/\">AngularJS :\u00a0Adding Items to a JavaScript List and updating corresponding DOM Dynamically<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-text-suggestions\/\">AngularJS :\u00a0Text Suggestions<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-sorting-objects-on-various-attributes\/\">AngularJS :\u00a0Sorting objects on various attributes<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-fetching-data-from-the-server\/\">AngularJS :\u00a0Fetching data from the server<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-multiple-views-layout-template-and-routing\/\">AngularJS :\u00a0Multiple Views, Layout\u00a0Template\u00a0and Routing<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/angularjs-implementing-routes-and-multiple-views\/\">AngularJS :\u00a0Implementing Routes And Multiple Views<\/a><\/li>\n<li><a href=\"https:\/\/2thenew.online\/blog\/building-intuitive-frontend-interfaces-with-angularjs\/\">Building Intuitive Frontend Interfaces with AngularJS<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":9,"footnotes":""},"categories":[1185],"tags":[3955,955,4697,1420,1450,1451,456],"class_list":["post-14359","post","type-post","status-publish","format-standard","hentry","category-node-js-2","tag-angular-development","tag-angularjs","tag-angularjs-development-company","tag-controller","tag-provider","tag-service","tag-sharing"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Amit Kumar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.online\/blog\/service-in-angularjs\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Service in AngularJS | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.online\/blog\/service-in-angularjs\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Service in AngularJS | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#article\",\"name\":\"Service in AngularJS | TO THE NEW Blog\",\"headline\":\"Service in AngularJS\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2014-06-29T21:21:45+05:30\",\"dateModified\":\"2017-08-03T16:00:41+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#webpage\"},\"articleSection\":\"Node.js, angular development, AngularJS, AngularJS Development Company, controller, provider, service, sharing\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"name\":\"Node.js\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"position\":2,\"name\":\"Node.js\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#listItem\",\"name\":\"Service in AngularJS\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#listItem\",\"position\":3,\"name\":\"Service in AngularJS\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/node-js-2\\\/#listItem\",\"name\":\"Node.js\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/859356966acd3c3879759369c7ac72cfb81228287bfc78e99c3080bee9b6b9ba?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Amit Kumar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/\",\"name\":\"Service in AngularJS | TO THE NEW Blog\",\"description\":\"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\\\/Data etc. All the components have their own work\\\/role but today we will discuss only Services. Services are that part of application where we write our business logic\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/service-in-angularjs\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/amit-kumar\\\/#author\"},\"datePublished\":\"2014-06-29T21:21:45+05:30\",\"dateModified\":\"2017-08-03T16:00:41+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Service in AngularJS | TO THE NEW Blog","description":"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic","canonical_url":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#article","name":"Service in AngularJS | TO THE NEW Blog","headline":"Service in AngularJS","author":{"@id":"https:\/\/2thenew.online\/blog\/author\/amit-kumar\/#author"},"publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"},"datePublished":"2014-06-29T21:21:45+05:30","dateModified":"2017-08-03T16:00:41+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#webpage"},"articleSection":"Node.js, angular development, AngularJS, AngularJS Development Company, controller, provider, service, sharing"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.online\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","name":"Node.js"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","position":2,"name":"Node.js","item":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#listItem","name":"Service in AngularJS"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#listItem","position":3,"name":"Service in AngularJS","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/#listItem","name":"Node.js"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.online\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.online\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.online\/blog\/author\/amit-kumar\/#author","url":"https:\/\/2thenew.online\/blog\/author\/amit-kumar\/","name":"Amit Kumar","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/859356966acd3c3879759369c7ac72cfb81228287bfc78e99c3080bee9b6b9ba?s=96&d=mm&r=g","width":96,"height":96,"caption":"Amit Kumar"}},{"@type":"WebPage","@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#webpage","url":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/","name":"Service in AngularJS | TO THE NEW Blog","description":"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.online\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.online\/blog\/author\/amit-kumar\/#author"},"creator":{"@id":"https:\/\/2thenew.online\/blog\/author\/amit-kumar\/#author"},"datePublished":"2014-06-29T21:21:45+05:30","dateModified":"2017-08-03T16:00:41+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.online\/blog\/#website","url":"https:\/\/2thenew.online\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.online\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Service in AngularJS | TO THE NEW Blog","og:description":"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic","og:url":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/","og:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Service in AngularJS | TO THE NEW Blog","twitter:description":"When we are working on MVC (or MVVM for AngularJS) Design-Patterns, our application is loosely coupled because of different independent components defined for e.g. Controller, View, Services, Modal\/Data etc. All the components have their own work\/role but today we will discuss only Services. Services are that part of application where we write our business logic","twitter:image":"https:\/\/2thenew.online\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"14359","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"blog","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 08:01:25","updated":"2024-02-29 10:45:24","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.online\/blog\/category\/node-js-2\/\" title=\"Node.js\">Node.js<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tService in AngularJS\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.online\/blog"},{"label":"Node.js","link":"https:\/\/2thenew.online\/blog\/category\/node-js-2\/"},{"label":"Service in AngularJS","link":"https:\/\/2thenew.online\/blog\/service-in-angularjs\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/14359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/comments?post=14359"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/posts\/14359\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/media?parent=14359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/categories?post=14359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.online\/blog\/wp-json\/wp\/v2\/tags?post=14359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}