

{"id":46875,"date":"2019-01-13T09:39:24","date_gmt":"2019-01-13T04:09:24","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=46875"},"modified":"2020-01-31T10:45:53","modified_gmt":"2020-01-31T05:15:53","slug":"angularjs-ng-view","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/","title":{"rendered":"AngularJS ng-view &#8211; Learn How to Implement View in AngularJS?"},"content":{"rendered":"<p><a href=\"https:\/\/data-flair.training\/blogs\/angularjs-tutorial-for-beginner\/\"><strong>Angular technology<\/strong><\/a> is known for making a single page application. It means multiple views is displayed on a single page without reloading the page. The new page gets displayed on the existing page. AngularJS has provided ng view, ng-template directives and $routeProvider service, for this purpose. Here, we will learn about ng view and its implementation process.<\/p>\n<p>So, are you ready to learn ng view in AngularJS?<\/p>\n<div id=\"attachment_48573\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-48573\" class=\"wp-image-48573 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg\" alt=\"ng-view implementation Process\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-48573\" class=\"wp-caption-text\">ng-view implementation Process<\/p><\/div>\n<h2>1. What is View in AngularJS (ng-View)?<\/h2>\n<p>AngularJS View is a content which is displayed to the user. According to a user request, the view of an application is displayed to the user. Since in one single page application, it can have a number of views. Therefore, according to the user\u2019s choice, a view is shown. Using the combination of views and <strong>routes<\/strong>, an application can be divided in logical views and bind different views to controllers.<\/p>\n<p>Our application become more manageable by dividing it into into different views and using routing to load different views of an application.\u00a0For example, we have a registration application, in which an admin can add new students and view students.<\/p>\n<div id=\"attachment_46877\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-46877\" class=\"size-full wp-image-46877\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1.jpg\" alt=\"ng view in AngularJS Example\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-1-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-46877\" class=\"wp-caption-text\">Example of ng view in AngularJS<\/p><\/div>\n<p>To implement this registration application, instead of creating two different web pages one for add student and another for view student, in angular we can create two different views on the same page.<\/p>\n<p>Hence, we have two reference links in our application. One is <strong>#show<\/strong> and another is<strong> #new<\/strong>. Therefore, when the application goes to MyApp#show, it will show the view of view student but it will not leave the existing page. Similarly, when the application goes to MyApp#new, it will show the view of add student in the existing page.<\/p>\n<p>We have to make multiple controllers for multiple views. As every view have its corresponding <strong>controller<\/strong> that will control the business logic for that functionality.<\/p>\n<h2>2. ng view in AngularJS<\/h2>\n<p>ng- view is a <a href=\"https:\/\/data-flair.training\/blogs\/angularjs-directives\/\"><strong>directive<\/strong><\/a> that works like a placeholder. It creates a placeholder where a corresponding view can be placed based on the configuration. Here, a view can be HTML or ng-template view.<\/p>\n<h2>3. How ng view Implements?<\/h2>\n<p>To implement ng-view in AngularJS follow this procedure:<\/p>\n<ul>\n<li>\n<h4>Step &#8211; 1<\/h4>\n<\/li>\n<\/ul>\n<p>First, include the angular-route file as a script reference.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;script src= \u201clib\/angular-route.js\u201d&gt;&lt;\/script&gt;<\/pre>\n<p>This route file is necessary to make use of functionalities having multiple routes and views. It can be downloaded from <a href=\"https:\/\/angularjs.org\/\">AngularJS website<\/a>.<\/p>\n<ul>\n<li>\n<h4>Step &#8211; 2<\/h4>\n<\/li>\n<\/ul>\n<p>In this step,<\/p>\n<ol>\n<li>Add HREF tags, which will represent links to &#8220;Adding a New Student&#8221; and &#8220;Displaying Student&#8221;.<\/li>\n<li>Then add a div tag with the ng view directive, which will represent the view. This will allow the corresponding view to be injected whenever the user clicks on either the &#8220;Add a New Student&#8221; or the &#8220;Displaying Student&#8221;.<\/li>\n<\/ol>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;div class=\"container\"&gt;\r\n   &lt;ul&gt;&lt;li&gt;&lt;a href=\"#!NewEvent\"&gt; Add New Student&lt;\/a&gt;&lt;\/li&gt;\r\n      &lt;li&gt;&lt;a href=\"#!DisplayEvent\"&gt; Display Student&lt;\/a&gt;&lt;\/li&gt;&lt;\/ul&gt;\r\n   &lt;div ng-view&gt;&lt;\/div&gt;&lt;\/div&gt;<\/pre>\n<ul>\n<li>\n<h4>Step &#8211; 3<\/h4>\n<\/li>\n<\/ul>\n<p>In your script tag, add the following code.<\/p>\n<p>This section of code means that when the user clicks on the HREF tag &#8220;Add New Student&#8221; which was defined in the div tag earlier. It will go to the web page add_student.html, and will take the code from this particular web page and inject it into the view. Secondly, for processing the business logic for this view, go to the &#8220;AddStudentController&#8221;.<\/p>\n<p>This section of code means that\u00a0when the user clicks on the HREF tag &#8220;DisplayStudent&#8221; which was defined in the div tag earlier. It will go to the web page show_student.html, take the code from there and inject it into the view. Secondly, for processing the business logic for this view, go to the &#8220;ViewStudentController&#8221;.<\/p>\n<p>The code written in otherwise method in below code means that the default view shown to the user is the DisplayStudent view.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">var app = angular.module('sampleApp',[\"ngRoute\"]);\r\napp.config(function($routeProvider){\r\n   $routeProvider.\r\n   when(\"\/NewStudent\",{\r\n      templateUrl : \"add_student.html\",\r\n      controller: \"AddStudentController\"\r\n   }).\r\n   when(\"\/DisplayStudent\", {\r\n     templateUrl: \"show_student.html\",\r\n     controller: \"ViewStudentController\"\r\n   }).\r\n    otherwise ({\r\n       redirectTo: '\/DisplayStudent'\r\n    });\r\n  });\r\n<\/pre>\n<ul>\n<li>\n<h4>Step &#8211; 4<\/h4>\n<\/li>\n<\/ul>\n<p>Next step is to add controllers for both the &#8220;DisplayStudent&#8221; and &#8220;Add New Student&#8221; functionality. When the corresponding view will show to the user than the message will appear. Further, this will add to the process of business logic.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">app.controller(\"AddStudentController\", function($scope) {\r\n     $scope.message = \"This is to Add a new Student\";\r\n   });\r\napp.controller(\"ViewStudentController\",function($scope){\r\n    $scope.message = \"This is display an Student\";\r\n  });<\/pre>\n<ul>\n<li>\n<h4>Step &#8211; 5<\/h4>\n<\/li>\n<\/ul>\n<p>Create pages called add_student.html and show_student.html.<\/p>\n<p>In our case, the add_student.html page will have a header tag along with the text &#8220;Add New Student&#8221; and have an expression to display the message &#8220;This is to Add a new Student&#8221;.<\/p>\n<p>Similarly, the show_student.html page will also have a header tag to hold the text &#8220;Display Student&#8221; and also have a message expression to display the message &#8220;This is to display students.&#8221;<\/p>\n<p>The value of the message variable will be injected based on the controller which is attached to that view.<\/p>\n<p>For each page, we are going to add the message variable, which can inject from each corresponding controller.<\/p>\n<p><strong>i. add_student.html<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;h2&gt;Add New Student&lt;\/h2&gt;\r\n{{message}}<\/pre>\n<p><strong>ii. show_student.html<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;h2&gt;Display Student&lt;\/h2&gt;\r\n{{message}}\r\n<\/pre>\n<p><strong>Code for the scenario<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n     &lt;meta chrset=\"UTF 8\"&gt;\r\n     &lt;title&gt; Registration&lt;\/title&gt;\r\n     &lt;script src=\"https:\/\/code.angularjs.org\/1.5.9\/angular-route.js\"&gt;&lt;\/script&gt;\r\n     &lt;script src=\"https:\/\/code.angularjs.org\/1.5.9\/angular.min.js\"&gt;&lt;\/script&gt;\r\n     &lt;script src=\"lib\/bootstrap.js\"&gt;&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body ng-app=\"sampleApp\"&gt;\r\n&lt;div class=\"container\"&gt;\r\n     &lt;ul&gt;&lt;li&gt;&lt;a href=\"#!NewStudent\"&gt; Add New Student&lt;\/a&gt;&lt;\/li&gt;\r\n        &lt;li&gt;&lt;a href=\"#!DisplayStudent\"&gt; Display Student&lt;\/a&gt;&lt;\/li&gt;\r\n     &lt;\/ul&gt;\r\n     &lt;div ng-view&gt;&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;script&gt;\r\n     var app = angular.module('sampleApp',[\"ngRoute\"]);\r\n     app.config(function($routeProvider){\r\n          $routeProvider.\r\n          when(\"\/NewStudent\",{\r\n               templateUrl : \"add_student.html\",\r\n               controller: \"AddStudentController\"\r\n          }).\r\n           when(\"\/DisplayStudent\", {\r\n               templateUrl: \"show_student.html\",\r\n                    controller: \"ViewStudentController\"\r\n          }).\r\n          otherwise ({\r\n          redirectTo: '\/DisplayStudent'\r\n     });\r\n});\r\napp.controller(\"AddStudentController\", function($scope) {\r\n     $scope.message = \"This is to Add a new Student\";\r\n});\r\napp.controller(\"ViewStudentController\",function($scope){\r\n     $scope.message = \"This is to display Student\";\r\n});\r\n&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<ul>\n<li>Add New Student<\/li>\n<li>Display Student<\/li>\n<\/ul>\n<p>This is to add the new student<\/p>\n<p>If we want to display the display Student view the output will be:<\/p>\n<ul>\n<li>Add New Student<\/li>\n<li>Display Student<\/li>\n<\/ul>\n<p>This is to display student<\/p>\n<p><strong>Flow Chart for ng-view implementation<\/strong><\/p>\n<div id=\"attachment_46878\" style=\"width: 1091px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-46878\" class=\"size-full wp-image-46878\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2.jpg\" alt=\"Flow Chart for ng-view implementation\" width=\"1081\" height=\"1080\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2.jpg 1081w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-150x150.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-300x300.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-768x767.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-1024x1024.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-160x160.jpg 160w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-320x320.jpg 320w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/AngularJS-ng-view-2-520x520.jpg 520w\" sizes=\"auto, (max-width: 1081px) 100vw, 1081px\" \/><\/a><p id=\"caption-attachment-46878\" class=\"wp-caption-text\">Flow Chart for ng-view implementation<\/p><\/div>\n<h2>4. Conclusion<\/h2>\n<p>Hence, we learned all the steps for implementation of ng view in AngularJS with their syntax and examples. Hope, you liked our explanation. Furthermore, if you have any query, feel free to approach us through comment box. We will definitly come to you!<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1680,&quot;href&quot;:&quot;https:\\\/\\\/angularjs.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251012132518\\\/https:\\\/\\\/angularjs.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 16:56:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-16 02:56:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-24 06:09:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 12:33:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-03 15:56:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-08 03:38:13&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-12 16:19:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-20 14:42:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-26 19:45:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-03 07:20:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 17:57:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 16:10:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 09:22:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-25 06:28:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 03:52:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-07 17:37:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 15:27:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 02:00:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-22 18:31:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-26 20:27:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 13:34:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-07 18:08:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-16 17:59:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 14:32:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-29 10:50:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-04 14:38:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-13 05:55:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-26 07:28:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-11 21:16:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-15 22:44:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-21 16:17:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-27 02:54:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-30 15:07:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-06 11:51:50&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-06 11:51:50&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular technology is known for making a single page application. It means multiple views is displayed on a single page without reloading the page. The new page gets displayed on the existing page. AngularJS&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":48573,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18153],"tags":[18377,18379,18380,18375,18376,18378],"class_list":["post-46875","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-angularjs","tag-angularjs-ng-view","tag-how-to-implement-ng-view","tag-ng-view-directive","tag-ng-view","tag-ng-view-in-angularjs","tag-what-is-ngview"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AngularJS ng-view - Learn How to Implement View in AngularJS? - DataFlair<\/title>\n<meta name=\"description\" content=\"What is View in AngularJS, Learn How to implement ng view in angularJS with syntax and example, ng-view directives in angularJS\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AngularJS ng-view - Learn How to Implement View in AngularJS? - DataFlair\" \/>\n<meta property=\"og:description\" content=\"What is View in AngularJS, Learn How to implement ng view in angularJS with syntax and example, ng-view directives in angularJS\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-13T04:09:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-31T05:15:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AngularJS ng-view - Learn How to Implement View in AngularJS? - DataFlair","description":"What is View in AngularJS, Learn How to implement ng view in angularJS with syntax and example, ng-view directives in angularJS","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:\/\/data-flair.training\/blogs\/angularjs-ng-view\/","og_locale":"en_US","og_type":"article","og_title":"AngularJS ng-view - Learn How to Implement View in AngularJS? - DataFlair","og_description":"What is View in AngularJS, Learn How to implement ng view in angularJS with syntax and example, ng-view directives in angularJS","og_url":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-01-13T04:09:24+00:00","article_modified_time":"2020-01-31T05:15:53+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"AngularJS ng-view &#8211; Learn How to Implement View in AngularJS?","datePublished":"2019-01-13T04:09:24+00:00","dateModified":"2020-01-31T05:15:53+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/"},"wordCount":897,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg","keywords":["AngularJS ng-view","How to implement ng-view","ng view directive","ng-view","ng-view in AngularJS","What is ngview"],"articleSection":["AngularJS Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/","url":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/","name":"AngularJS ng-view - Learn How to Implement View in AngularJS? - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg","datePublished":"2019-01-13T04:09:24+00:00","dateModified":"2020-01-31T05:15:53+00:00","description":"What is View in AngularJS, Learn How to implement ng view in angularJS with syntax and example, ng-view directives in angularJS","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/01\/ng-view-implementation-Process.jpg","width":1200,"height":628,"caption":"ng-view implementation Process"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/angularjs-ng-view\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"AngularJS Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/angularjs\/"},{"@type":"ListItem","position":3,"name":"AngularJS ng-view &#8211; Learn How to Implement View in AngularJS?"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/46875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=46875"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/46875\/revisions"}],"predecessor-version":[{"id":48574,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/46875\/revisions\/48574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/48573"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=46875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=46875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=46875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}