如何在twitter bootstrap 3.0(而非2.3.x)中制作更大的Glyphicons.
这段代码会让我的glyphicons变大:
<button type="button" class="btn btn-default btn-lg">
<span class="glyphicon glyphicon-th-list">
</span>
</button>
Run Code Online (Sandbox Code Playgroud)
如果在仅使用跨度时不使用btn-lg类,如何获得此大小?
这给出了一个小的glyphicon:
<span class="glyphicon glyphicon-link"></span>
Run Code Online (Sandbox Code Playgroud) 现在,每当我想将node.js服务器部署到我的生产服务器时,我需要更改我的数据库和外部API的各种连接的所有IP/DNS /用户名/密码.
这个过程很烦人,有没有办法验证当前运行的node.js实例是在cloud9ide还是实际上我的生产中的智能机器?
如果我能够在我的运行代码中运行我的node.js实例运行的服务器,我将添加一个条件,将值设置为prod或dev.
谢谢
我想知道是否有这种问题的简单解决方案.
我有一个对象注释,它可以包含注释,这些注释也可以包含注释......这可以继续进行未知数量的周期.
以下是数据结构的示例:
var comment = {
text : "",
comments: [
{ text: "", comments : []},
{ text: "", comments: [
{ text: "", comments : []},
{ text: "", comments : []}
{ text: "", comments : []}
]}
]
}
Run Code Online (Sandbox Code Playgroud)
让我们说,我会写两个级别的评论:
<div ng-repeat="comment in comments">
{{comment.text}}
<div ng-repeat="comment in comments">
{{comment.text}}
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我如何为"n"级嵌套注释实现我的div?
我正在尝试获取特定频道中特定成员的未读消息数.为此,我希望使用文档中定义的channel.getUnconsumedMessagesCount().
myChannel.join()
.then(function(c) {
console.log('Joined channel ' + c.sid);
return myChannel.getUnconsumedMessagesCount();
})
.then(m => {
console.log('current count unread: ' + m);
});
Run Code Online (Sandbox Code Playgroud)
未读计数始终返回0.要测试,我执行以下操作:
最初我调用了.getUnconsumedMessagesCount()而没有首先进行join(),我认为这可能是问题,但即使加入仍然没有.
我试图理解包含的代码片段行为,它不能像我期望的那样工作.这是我正在做的事情:
我的问题是在(5),任何作为主LINQ对象的属性的LINQ实体都消失了,即使在(3)的验证时它仍然存在.我所有的LINQ类都是LINQ to SQL.我正在使用Newtons JSON.Net库.我尝试使用非linq对象的相同类型的逻辑,并且不会发生在(5)处看到的缺陷.
var infoId = Guid.NewGuid();
var alertId = Guid.NewGuid();
var info = new Info();
info.InfoId = infoId;
var alert = new Alert();
alert.AlertId = alertId;
alert.Infos.Add(info);
var json = JsonConvert.SerializeObject(alert);
Debug.WriteLine(json); //All looking good, nothing missing
var deserializedObject = JsonConvert.DeserializeObject<Alert>(json);
Assert.AreEqual(alertId, deserializedObject.AlertId); //Assert is valid
Assert.AreEqual(infoId, deserializedObject.Infos[0].InfoId); //Assert is valid
var json2 = JsonConvert.SerializeObject(deserializedObject);
Debug.WriteLine(json2); //Infos is gone
Run Code Online (Sandbox Code Playgroud)
更新:
我做了一些debbugging,并在序列化deserializedObject
var json2 = JsonConvert.SerializeObject(deserializedObject);
Run Code Online (Sandbox Code Playgroud)
到达Info Serialization步骤时我看到以下内容(下一个代码被剪切):
我似乎无法在谷歌和猫鼬网站上找到答案,所以我在这里问.如果可能,我如何在文档中搜索部分匹配的字符串.
例如:
在用户集合中:
{ name: "Louis", location: "Paris, France" },
{ name: "Bill", location: "Paris, Illinoid" },
{ name: "Stephen", location: "Toronto, Ontario" }
Run Code Online (Sandbox Code Playgroud)
猫鼬功能:
searchForCity("Paris");
Run Code Online (Sandbox Code Playgroud)
结果将是位于字符串String中的"Paris"的User集合中的文档列表.例如:
[
{ name: "Louis", location: "Paris, France" },
{ name: "Homer", location: "Paris, Illinois" }
]
Run Code Online (Sandbox Code Playgroud) 我试图在下拉列表中读取所选的选项名称/ text/html,而不是通过angular.js读取它的值.我是这样做的,但这会返回值,而不是名称:
在我的HTML中
<select class="SelectCar" ng-model="SelectedCar">
<option ng-repeat="car in cars" value="{{car.Guid}}">
{{car.Name}}
</option>
</select>
Run Code Online (Sandbox Code Playgroud)
在我的控制器中
var car = $scope.SelectedCar;
Run Code Online (Sandbox Code Playgroud)
"汽车"的价值将是car.Guid,但我想将汽车返回.姓名.我无法删除car.Guid的值,因为这个Guid被我的应用程序中的另一个组件使用.
我最近开始开发另一个GWT模块.所以我创建了一个包含所有新类和一个实现新入口点的特定类的包.我在我的gwt.xml中修改了我的新入口点.当我编译时,我收到以下错误:
GWT Compiling client-side code.
WARNING: 'com.google.gwt.dev.GWTCompiler' is deprecated and will be removed in a future release.
Use 'com.google.gwt.dev.Compiler' instead.
(To disable this warning, pass -Dgwt.nowarn.legacy.tools as a JVM arg.)
Compiling module com.test.gwt
Finding entry point classes
[ERROR] Unable to find type 'com.test.ajax.input.createEntryPoint'
[ERROR] Hint: Previous compiler errors may have made this type unavailable
Run Code Online (Sandbox Code Playgroud)
这不是大写字母错误,gwt.xml中的路径和我的实际包都写得一样......任何线索?
我使用以下代码在数组中添加一些内容并增加两个不同的计数器.
该项目已在数组中正确推送,并且pendingSize正确递增.但unRead永远不会增加.它曾经增加,然后今天它停止了.我的mongodb集合中的unRead字段的值(在mongohq上托管)设置为0(数字,而不是字符串)
当我查看我的控制台时,我看到"更新成功".
任何线索为什么它停止工作?
谢谢
Notifications.update({ "id" : theid}, { $push: { pending: notification}, $inc: { unRead : 1 }, $inc: { pendingSize: 1 }}, function(err){
if(err){
console.log('update failed');
callback("Error in pushing." + result.members[i]);
}
else{
console.log('update succes');
callback("Success");
}
});
Run Code Online (Sandbox Code Playgroud) 当我点击下面定义的按钮时,模态框不会显示.如果我使用chrome开发工具,我会看到我的div"modalDisplay"填充了我的modalDisplay.html内容,但是当我点击按钮时,没有任何反应,没有错误,什么都没有.我正在使用angularjs与angularjs bootstrap插件
在我的部分视图中,我有以下内容:
<div id="modalDisplay" class="modal hide fade" ng-include="'./app/templates/modalDisplay.html'"></div>
<button class="btn btn-primary" href="#modalDisplay" data-toggle="modal" ng-show="displayType=='Customer'">
Show Modal
</button>
Run Code Online (Sandbox Code Playgroud)
在我的modalDisplay.html中
<div ng-controller="mODALCtrl" class="ng-scope">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>My modal</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
<div></div>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) javascript ×6
angularjs ×3
express ×2
mongodb ×2
mongoose ×2
node.js ×2
angular ×1
c# ×1
cloud9-ide ×1
css ×1
glyphicons ×1
gwt ×1
html ×1
java ×1
java-ee ×1
joyent ×1
json.net ×1
linq ×1
linq-to-sql ×1
mongohq ×1
twilio ×1
twilio-api ×1