任何人都可以帮助我理解为什么当我在html标签中引导角度时,每个元标记都有应用程序的DOM?我正在处理动态元标记,但这种情况只是通过引导html而不是body来存在。
或者任何人都可以验证这是正常的,不会给我一个性能问题,应该被忽略吗?
这里是module.config函数的开头:
angular.module('numetal')
.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
'use strict';
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
$urlRouterProvider.otherwise('/');
$stateProvider
.state('metal', {
url: '',
template: '<layout></layout>',
abstract: true,
controller: function (Facts) {
var vm = this;
vm.a = Facts.api;
vm.d = Facts.data;
vm.s = Facts.state;
vm.u = Facts.ux;
},
controllerAs: 'metal',
data: function (State) {
return {
head: {
title: 'Forging Technology - Serving Vancouver with Superior Metalwork',
keywords: State.params,
description: "your meta description",
robots: "index,follow",
canonical: 'http://www.mySite.tld/home'
}
}
}
})
.state('metal.home', {
url: '/',
template: '<posts></posts>',
data: function (State) {
return {
head: {
title: 'Forging Technology Proudly Serving Vancouver with Superior Metalwork',
keywords: State.params,
description: "Posts from Forging Technology, Vancouver Metalwork",
robots: "index,follow",
canonical: 'http://www.mySite.tld/home'
}
}
}
})
谢谢大家!