以下是我的index.html
页面:
<title>Mytitle<title>
<meta name="keywords" content="abc,xyz"/>
<meta name="description" content="cde,fgh"/>
我想在signup.html
页面中找到不同的标题,关键字和说明:
(signup.html
页面下的index.html
页面渲染)
<title>Signup Title<title>
<meta name="keywords" content="signup, free"/>
<meta name="description" content="do signup for free"/>
答案 0 :(得分:0)
对于您的情况,您可以将应用程序和控制器添加到HTML标记(例如)并使用数据绑定,如下所示:
<html ng-app="yourApp" ng-contoller="YourController">
<head>
<title>{{title}}<title>
<meta name="keywords" content="{{keywordsContent}}"/>
<meta name="description" content="{{descriptionContent}}"/>
</head>
...
</html>
在您的YourController
:
angular
.module('yourApp', [])
.controller('YourController', ['$scope', YourController]);
function YourController($scope) {
$scope.title = "Mytitle";
$scope.keywordsContent = "abc,xyz";
$scope.descriptionContent = "cde,fgh";
}
您可以使用$scope.$parent
:
angular
.module('yourApp', [])
.controller('ChildController', ['$scope', ChildController]);
function ChildController($scope) {
$scope.$parent.title = "Changed Title";
$scope.$parent.keywordsContent = "Changed Keywords";
$scope.$parent.descriptionContent = "Changed Description";
}