<!DOCTYPE html>\n<html ng-app="MainApp">\n <head>\n <meta charset="utf-8">\n <title>\u307b\u3052\u307b\u3052<\/title>\n <script src="https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.3.0-beta.13\/angular.min.js"><\/script>\n <!--\n \u3053\u3053\u306e\uff11\u884c\u304c\u306a\u304b\u3063\u305f\uff01\u3053\u308c\u306b\u3088\u3063\u3066\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\n -->\n <script src="https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.3.0-beta.13\/angular-route.min.js"><\/script>\n <script src="script.js"><\/script>\n <\/head>\n <body>\n <!-- ng-view\u304c\u6307\u5b9a\u3055\u308c\u305f\u30bf\u30b0\u306e\u5185\u90e8\u304c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3088\u3063\u3066\u5909\u5316\u3059\u308b -->\n <div ng-view><\/div>\n <\/body>\n<\/html><\/code><\/pre><\/div>\n\n\n\n\u6b21\u306b\u3001\u3053\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6a5f\u80fd\u3092\u4f7f\u3044\u307e\u3059\u3001\u3068\u5ba3\u8a00\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
\/\/ ngRoute\u304c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6a5f\u80fd\u3092\u53f8\u308b\nconst MainApp = angular.module('MainApp', ['ngRoute']);<\/code><\/pre><\/div>\n\n\n\n<\/span>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u66f8\u304f<\/span><\/h2>\n\n\n\n\u6b21\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u30eb\u30fc\u30eb\u3092\u8a18\u8ff0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
URL\u306e\u6587\u5b57\u5217\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308bController(mainCtrl<\/code>)\u3068templateUrl(view1.html<\/code>, view2.html<\/code>)\u3092\u6307\u5b9a\u3057\u3066\u3042\u3052\u307e\u3059\u3002<\/p>\n\n\n\nconst MainApp = angular.module('MainApp', ['ngRoute']);\nMainApp.config(function($routeProvider){ \/\/ ngRoute\u306e$routeProvider\u304c\u4f7f\u3048\u308b\u3002\n $routeProvider.\n when('\/', { \/\/ '\/'\u306b\u30a2\u30af\u30bb\u30b9\u3055\u308c\u305f\u3068\u304d\u306f\n controller: 'mainsCtrl', \/\/ mainsCtrl\u3092\u4f7f\u3063\u3066\n templateUrl: 'view1.html', \/\/ view1.html\u306e\u4e2d\u8eab\u3092ng-view\u306e\u4e2d\u306b\u5165\u308c\u308b\u3002\n }).\n when('\/view2',{ \/\/ \u4ee5\u4e0b\u540c\u69d8\u306b\u3064\u306a\u3052\u3089\u308c\u308b\u3002\n controller: 'mainsCtrl',\n templateUrl: 'view2.html',\n }).\n otherwise({ \/\/ \u4e0a\u306e\u3082\u306e\u306b\u8a72\u5f53\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u306f\n redirectTo: '\/' \/\/ '\/'\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\n });\n});\nMainApp.controller('mainsCtrl', function($http, $scope){\n \/\/ \u3044\u3044\u611f\u3058\u306e\u51e6\u7406\u3002\n});<\/code><\/pre><\/div>\n\n\n\n<\/span>\u305d\u308c\u305e\u308c\u306eview\u3092\u66f8\u304f<\/span><\/h2>\n\n\n\n\u3042\u3068\u306fview1.html<\/code>\u3068view2.html<\/code>\u3092\u66f8\u3044\u3066\u3044\u304f\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<h1>view1<\/h1>\n<a ng-href="#\/view2">view2\u3078<\/a><\/code><\/pre><\/div>\n\n\n\n<h1>view2<\/h1>\n<a ng-href="#\/view1">view1\u3078<\/a><\/code><\/pre><\/div>\n\n\n\n<\/span>\u307e\u3068\u3081<\/span><\/h2>\n\n\n\n\u3053\u3093\u306a\u306b\u7c21\u5358\u306b\u753b\u9762\u306e\u518d\u30ed\u30fc\u30c9\u306a\u3057\u306e\u753b\u9762\u9077\u79fb\u304c\u3067\u304d\u308b\u3068\u697d\u3057\u3044\u3067\u3059\u3002<\/p>\n\n\n\n
\u3053\u308c\u3060\u3051\u3067\u306fWeb\u30b7\u30b9\u30c6\u30e0\u306f\u4f5c\u308c\u306a\u3044\u3067\u3059\u304c\u3001\u7c21\u5358\u306a\u30b9\u30e0\u30fc\u30ba\u306b\u52d5\u304f\u8efd\u3044Web\u30b5\u30a4\u30c8\u3092\u4f5c\u308b\u306e\u306b\u306f\u5341\u5206\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
\u305c\u3072\u3001\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"
AngularJS\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u30ac\u30a4\u30c9\u3068\u3044\u3046\u672c\u3092\u8cb7\u3063\u3066\u52c9\u5f37\u4e2d\u3067\u3059\u3002\u4eca\u3001\u5168\u4f53\u306e20%\u304f\u3089\u3044\u3057\u304b\u547c\u3093\u3067\u307e\u305b\u3093\u304c\u3001\u3060\u3044\u3076\u5168\u4f53\u50cf\u304c\u3064\u304b\u3081\u3066\u304d\u307e\u3057\u305f\u3002 \u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u53e4\u3044\u306e\u304b\u3001Changing Views with Route […]<\/p>\n","protected":false},"author":1,"featured_media":208445,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[41,5],"tags":[155,153,46,42,43,40],"class_list":["post-3591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-program","tag-angular","tag-angularjs","tag-for-beginner","tag-html","tag-javascript","tag-web"],"aioseo_notices":[],"jetpack_featured_media_url":"http:\/\/cms.inter-arteq.com\/wp-content\/uploads\/2022\/03\/angularjs-how-to-transition-page-view-with-ng-view.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3591"}],"collection":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/comments?post=3591"}],"version-history":[{"count":3,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3591\/revisions"}],"predecessor-version":[{"id":208408,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/3591\/revisions\/208408"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media\/208445"}],"wp:attachment":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media?parent=3591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/categories?post=3591"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/tags?post=3591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}