0
在特定頁面上注入元標記我有一個應用程序,我想注入一個smartBanner元標記,但只在某些頁面上。使用指令
在我的索引頁,我有:
<!DOCTYPE html>
<html ng-app="ngBoilerplate" ng-controller="AppCtrl">
<head>
<title ng-bind="pageTitle"></title>
<!-- add smart banner to select pages through smartBanner directive -->
<smart-banner></smart-banner>
</head>
<body>
<ui-view></ui-view>
</body>
</html>
我有一個指令:
angular.module('boh.components.smartBanner', [])
.directive('smartBanner', function(){
return {
restrict: "E",
template: '<meta name="apple-itunes-app" content="app-id=1080200000"></meta>',
replace: true
} ;
});
我的問題是,我只是通過注入指令到我的其他頁面控制器調用指令?