2017-04-11 12 views
0

私はセクションごとに1ページを含むウェブサイトを持っています。つまり、すべてのセクションには、自分のメタタグを持つ1ページがあります。SEO in AngularJS

AngularJSを使用して1つのページにすべてのセクションをルーティングするにはどうすればいいですか?現在、すべてのセクションに自分のメタタグの説明があります。

+0

HTML5モードでurlルーティングが必要な場合、crawlbotsはurサイトをクロールしてデータを保持できる – Webruster

答えて

1

NgMetaあなたの作品を見ることができます。

.config(function ($routeProvider, ngMetaProvider) { 
    $routeProvider 
    .when('/home', { 
    templateUrl: 'home-template.html', 
    data: { 
     meta: { 
     'title': 'Home page', 
     'description': 'This is the description shown in Google search results' 
     } 
    } 
    }) 
    .when('/login', { 
    templateUrl: 'login-template.html', 
    data: { 
     meta: { 
     'title': 'Login page', 
     'titleSuffix': ' | Login to YourSiteName', 
     'description': 'Login to the site' 
     } 
    } 
    }); 
    ... 
});