我希望有一个像这样的日期倒计时:
http://codepen.io/garethdweaver/pen/eNpWBb
但是在角度2中,我发现这个plunkr每500毫秒增加一个数字:
https://plnkr.co/edit/pVMEbbGSzMwSBS4XEXJI?p=preview
这是代码:
import {Component,Input} from 'angular2/core';
import {Observable} from 'rxjs/Rx';
@Component({
selector: 'my-app',
template: `
<div>
{{message}}
</div>
`
})
export class AppComponent {
constructor() {
Observable.interval(1000)
.map((x) => x+1)
.subscribe((x) => {
this.message = x;
}):
}
}
Run Code Online (Sandbox Code Playgroud)
但我希望约会一秒钟,直到达到0.
我有一张桌子
items
id int unsigned auto_increment primary key,
name varchar(255)
price DECIMAL(6,2)
Run Code Online (Sandbox Code Playgroud)
我希望从这张表中获得至少30个随机商品,其中总价格等于500,实现这一目标的最佳方法是什么?
我已经看到这个看起来有类似问题的解决方案MySQL选择3个随机行,其中三行的总和小于值
我想知道是否有任何其他解决方案更容易实现和/或更高效
我想要做的是重复三个级别.
演示:http://plnkr.co/edit/qXLcPHXDlOKZYI5jnCIp?p = preview
<table>
<thead>
<tr>
<td>Block</td>
<td>Column</td>
<td>Unit</td>
<td>Action</td>
</tr>
</thead>
<tbody ng-repeat="block in building.ownBlock">
<tr ng-repeat="column in block.ownColumn">
<td>{{block.name}}</td>
<td>{{column.number}}</td>
<td>{{unit.name}} - ? empty</td>
<td><button ng-click="edit(unit)">Edit</button></td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
但我没有这样做.
采集
$scope.building =
{
id: 1,
name: 'first',
ownBlock: [
{
id: 1,
name: 'Block 1',
ownColumn: [
{
id: 1,
number: 'Column 1-1',
ownUnit: [
{
id: 1,
number: 'Unit 1-1-1'
},
{
id: 2,
number: 'Unit 1-1-2'
}
]
},
{
id: …Run Code Online (Sandbox Code Playgroud) 我刚刚将我的MVC应用程序部署到子域,我无法让webapi工作.
在本地访问:localhost:40052/api/apiEmpreendimento/GetObjects工作得很好,但在线访问以下内容:http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects
给我
{"Message":"找不到与请求URI匹配的HTTP资源'http://subdomain.mysite.com/api/apiEmpreendimento/GetObjects'."}
App_Start/WebApiConfig.cs
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { action = "get", id = RouteParameter.Optional }
);
}
}
Run Code Online (Sandbox Code Playgroud)
任何提示都非常感谢.
谢谢
如果没有空格,我正试图在冒号和字符或数字之间添加一个空格:
this is my sentence:hi it's midnight
this is my sentence:2012 was a good year.
this sentence should be ignored: ignore me
Run Code Online (Sandbox Code Playgroud)
我想要它阅读:
this is my sentence: hi it's midnight
this is my sentence: 2012 was a good year.
this sentence should be ignored: ignore me
Run Code Online (Sandbox Code Playgroud)
我试过这个没有成功. 正则表达式在vim中插入空格
我可以使用这个得到":X"或":0"(它与冒号后面的空格不匹配,这很好):
:[^\s]
Run Code Online (Sandbox Code Playgroud)
但如果我替换为:
: $0
Run Code Online (Sandbox Code Playgroud)
最终结果如下:
this is my sentence: :hi it's midnight
this is my sentence: :2012 was a good year.
Run Code Online (Sandbox Code Playgroud)
我正在使用http://www.gskinner.com/RegExr/来测试模式.
我将使用PHP preg_replace函数
任何帮助深表感谢.提前致谢.