td{position: relative}包含元素(<i>)的组合transition在Chrome(版本54.0.2840.71 m,windows 10)浏览器中切换1,2,3在下面的片段(边框,背景)时使表闪烁(边框和背景).
这是期望的行为,错误,还是可以用一些CSS来解决?
(我需要有位置,因为其他代码也依赖它)
var app = angular.module('app', []);
app.controller('testCtrl', function($scope) {
$scope.bodys = [1, 2, 3];
});Run Code Online (Sandbox Code Playgroud)
table,
tr,
td {
position: relative;
}
td{
border-top: 1px solid darkgreen !important;
}
table {
table-layout: fixed;
}
.glyphicon-chevron-right {
transition: transform .3s;
cursor: pointer;
}
.toggled {
transform: rotate(90deg);
}
.odd {
background: lightgreen;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<body ng-app="app">
<table ng-controller="testCtrl" class="table">
<tbody ng-repeat="b in bodys">
<tr …Run Code Online (Sandbox Code Playgroud)我试图在第一页视图中获取所有部分内容,以便在应用程序查看期间不下载任何html.
index.html.<script type="text/ng-template" id="templateId.html">
<p>This is the content of the template</p>
</script>
Run Code Online (Sandbox Code Playgroud)
index.html文件变得难以管理并打破了项目的模块结构..js文件中,最有可能在文件中app.jsmyApp.run(function($templateCache) {
$templateCache.put('templateId.html', 'This is the content of the template');
});
Run Code Online (Sandbox Code Playgroud)
.js文件不是html代码的地方,而且还有与使用它相同的问题index.html.我想做的是,在不同的文件中有模板,所以我可以保留我的模块结构并在索引上预加载它们.
这就是我现在拥有的.
var cmsAppFirstRun = function ($templateCache, $templateRequest, $rootScope) {
$templateRequest('views/common/top-bar.html').then(function (response) {
$templateCache.put('top.bar', response);
$rootScope.templatesDone = true;
});
};
angular.module('cmsApp').run(cmsAppFirstRun);
Run Code Online (Sandbox Code Playgroud)
和HTML
<div ng-include="'top.bar'" ng-if="$root.templatesDone"></div>
Run Code Online (Sandbox Code Playgroud)