我试图理解Twitter Bootstrap下拉菜单当它们包含在导航栏中时和它们不包含时的区别.
当它们被包含在导航栏中时,在展开的菜单上会显示一个小的向上三角形/箭头.没有使用导航栏时,不会显示此三角形:
http://twitter.github.com/bootstrap/javascript.html#dropdowns
我只花了两个小时探索css/html,我仍然不明白为什么...
任何的想法 ?
在访问之前我解决一个用户帐户片段我的用户页面:
APP-routing.component.ts
{
path: 'users/:id',
component: UserComponent,
resolve: {user: UsersService},
children: [
{path: '', pathMatch: 'full', redirectTo: 'account'},
{path: 'account', component: UserAccountComponent},
{path: 'sites', component: UserSitesComponent}
]
}
Run Code Online (Sandbox Code Playgroud)
users.service.ts
resolve(route: ActivatedRouteSnapshot, r: RouterStateSnapshot) {
return this.getUser(route.params['id']);
}
Run Code Online (Sandbox Code Playgroud)
用户account.component.ts
ngOnInit() {
this.route.parent.data.subscribe(data => {
this.user = data['user'];
// Initialize the form and its validators
this.initForm();
});
}
Run Code Online (Sandbox Code Playgroud)
在用户帐户组件中,我可以保存或重置表单.在这两种情况下,我都想更新组件的用户并重置表单和验证器.理想情况下,它会再次触发订阅.
知道如何手动触发旋转变压器吗?
(我曾经重新导航到与最后一个片段模拟一个随机数的相同路径,但是由于我将用户页面分解为父/子路径,因此当最后一个片段发生变化时,不再调用父级中的解析器)
我需要ng build --prod在机器 #1上构建我的应用程序并ng serve --prod在机器 #2上使用我的应用程序
机器 #2不应该有源文件,也没有处理/RAM 容量来捆绑它们。
我找不到提供已捆绑文件的方法。
任何的想法 ?
我试图对包含在内联块元素中的文本进行省略号效果.
这是HTML:
<div class="container">
<div class="icon"></div>
<div class="line">This is a much tooooooooooooooooo long line</div>
</div>
Run Code Online (Sandbox Code Playgroud)
而CSS:
.container {
border: solid 1px black;
background-color: lightgrey;
white-space: nowrap;
padding: 10px;
width: 200px;
}
.icon {
border: solid 1px blue;
display: inline-block;
width: 16px;
height: 16px;
}
.line {
border: solid 1px red;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Run Code Online (Sandbox Code Playgroud)
看到.的jsfiddle
当然它的工作原理是在线上设置宽度或将其显示设置为阻止,但这对我的用例来说是禁忌.我被困在那里,任何想法?
编辑:哦,我应该指定行的开头应该有一些其他的内联块元素(实际上是树视图的缩进和图标)因此,文本容器的宽度不能是其父级的100%. .
我在使用GWT时遇到了问题.我正在构建一个cellTable的列,我希望单元格的样式取决于该单元格的值:
Column<MyProxy, MyProxy> editButtonColumn = new Column<MyProxy, MyProxy>(new ActionCell<MyProxy>("", new ActionCell.Delegate<MyProxy>() {
@Override
public void execute(MyProxy record) {
if (object.isEditable()) {
doSomething(record);
}
}
})) {
@Override
public MyProxy getValue(MyProxy object) {
if (object.isEditable()) {
this.setCellStyleNames("editButtonCell");
}
return object;
}
};
Run Code Online (Sandbox Code Playgroud)
我已经在调试模式下检查了正确应用"editButtonCell"样式.但是在生成的HTML中,每次为FIRST ROW都缺少样式......它看起来像一个GWT错误,但也许你们有更好的解释.
我想找到一个高效且优雅的解决方案来解决这个问题:
我需要通过已替换的函数替换字符串的子字符串,不区分大小写.
示例:
var highlight = function(inputString, filterString) {
var regex = new RegExp(filterString, 'gi');
return inputString.replace(regex, '<b>' + filterString + '</b>');
};
highlight('The input', 't');
Run Code Online (Sandbox Code Playgroud)
如果你在浏览器控制台中运行它,你会得到:
"<b>t</b>he inpu<b>t</b>"
Run Code Online (Sandbox Code Playgroud)
我的问题是我想保留替换字符串的原始情况.因此,预期结果将是:
"<b>T</b>he inpu<b>t</b>"
Run Code Online (Sandbox Code Playgroud)
任何的想法 ?
编辑:回复@georg:
return inputString.replace(regex, '<b>$&</b>');
css ×3
angular ×2
angular-cli ×1
celltable ×1
gwt ×1
html ×1
javascript ×1
regex ×1
resolver ×1
string ×1