小编hug*_*ugs的帖子

Angular ng-repeat每3或4个cols添加一个bootstrap行

我正在寻找正确的模式,每3列注入一个bootstrap行类.我需要这个,因为cols没有固定的高度(我不想修复它),所以它打破了我的设计!

这是我的代码:

<div ng-repeat="product in products">
    <div ng-if="$index % 3 == 0" class="row">
        <div class="col-sm-4" >
            ...
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

但它只在每行显示一个产品.我想要的最终结果是:

<div class="row">
    <div class="col-sm4"> ... </div>
    <div class="col-sm4"> ... </div>
    <div class="col-sm4"> ... </div>
</div>
<div class="row">
    <div class="col-sm4"> ... </div>
    <div class="col-sm4"> ... </div>
    <div class="col-sm4"> ... </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我只能用ng-repeat模式(没有指令或控制器)来实现这个目的吗?本文档介绍了NG-重复启动和NG-重复-结束,但我无法弄清楚如何使用它是这种使用情况!我觉得这是我们经常在bootstrap模板中使用的东西!?谢谢

twitter-bootstrap angularjs ng-repeat angularjs-ng-repeat

108
推荐指数
9
解决办法
9万
查看次数

使用最新的nodejs 1.10.15安装yeoman

将我的系统从Ubuntu 13.04迁移到13.10,我已经安装了Ubuntu Logiteque提供的最新nodejs软件包(这是自动软件包安装程序的frech名称,不知道英文是否相同......).

尝试使用命令安装yeoman:

npm install -g yo
Run Code Online (Sandbox Code Playgroud)

给我以下错误:

 npm http 200 https://registry.npmjs.org/is/-/is-0.2.7.tgz
/usr/local/bin/yo -> /usr/local/lib/node_modules/yo/cli.js

> yo@1.1.2 postinstall /usr/local/lib/node_modules/yo
> node ./scripts/doctor

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! yo@1.1.2 postinstall: `node ./scripts/doctor`
npm ERR! `sh "-c" "node ./scripts/doctor"` failed with 127
npm ERR! 
npm ERR! Failed at the yo@1.1.2 postinstall script.
npm ERR! This is most …
Run Code Online (Sandbox Code Playgroud)

node.js ubuntu-13.10

9
推荐指数
2
解决办法
3626
查看次数

将facebook SDK导入cordova/phonegap项目

我正在使用cordova 3.3.0(又名phonegap)创建我的第一个应用程序.一切都很好:我可以将项目运行到Android设备模拟器和我的手机上.

我想使用facebook连接插件:https: //github.com/phonegap/phonegap-facebook-plugin

但我读过的所有文档(特别是:https://developers.facebook.com/docs/android/getting-started)都解释了如何通过Eclipse设置Facebook SDK.我还找到了有关如何在AndroïdStudio中安装的文档.

我不想安装它们,我在命令行中完成所有操作,因为我想知道事情是如何工作的(至少对于我的第一个项目来说......).

所以问题是:如何将facebook SDK导入我的cordova项目?

谢谢你的想法!

android cordova facebook-sdk-3.0 cordova-3

6
推荐指数
1
解决办法
3305
查看次数

Grunt php和css代

我正在使用yeoman,我已经安装了grunt-php,我可以加载php文件,但是没有访问css文件.似乎scss没有被编译或者我的index.php中的路径没有指向tmp css文件.

我尝试了不同的问题(改变路径),但我无法修复它.

这是我的index.php标题:

    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>wine trip yo</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">
    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <!-- build:css(.tmp) styles/main.css -->
    <link rel="stylesheet" href="styles/main.css">
    <!-- endbuild -->
    <!-- build:js scripts/vendor/modernizr.js -->
    <script src="bower_components/modernizr/modernizr.js"></script>
    <!-- endbuild -->
</head>
Run Code Online (Sandbox Code Playgroud)

这是我的Gruntfile:

// Generated on 2013-10-14 using generator-webapp 0.4.3
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want …
Run Code Online (Sandbox Code Playgroud)

css gruntjs grunt-usemin

5
推荐指数
1
解决办法
1686
查看次数

在bootstrap 3中没有初始化

我试图通过twitter bootstrap集成的优秀footable插件不会初始化.也就是说,感谢我的firebug检查员,我可以看到该表是由footable插件处理的,但我总是希望隐藏该行:

data-hide="all"
Run Code Online (Sandbox Code Playgroud)

是可见的.如果我改变浏览器的大小,那么表格就有我期望在页面启动时应该具有的行为.

我尝试过firefox/chrome和不同的jQuery版本,但仍然相同!

我采取了最简单的足迹示例,看看发生了什么,但没有更多的运气!据说它足以与开箱即用的bootstrap一起工作.

我正在使用requireJS在我的页面上加载大量脚本,但没有错误.我无法理解如何通过footable识别表格,但它的属性不会激活!

感谢您的任何调查方式!

编辑:我已经明白问题来自我的表是在页面加载隐藏div(使用引导向导)所以添加:

onTabShow: function(tab, navigation, index) {
if(index===3){
        $('.footable').trigger('footable_initialize');
}
Run Code Online (Sandbox Code Playgroud)

}

做了诀窍:)

jquery footable twitter-bootstrap-3

1
推荐指数
1
解决办法
5698
查看次数

如何根据用户配额限制MySQL结果

今天我的SQl问题是如何根据用户配额限制一些查询结果.

这是用例:

  • 用户拥有1 ... N个网站,其中包含1 ... N个网页
  • 用户有一个scan_quota,允许他(或不)访问他的网页

用户

+-----+------------+
| id  | scan_quota |
+-----+------------+
|   1 |          0 |
|   2 |         10 |
|   3 |         20 |
+-----+------------+
Run Code Online (Sandbox Code Playgroud)

网站

+-----+---------+------------------------------------------------+
| id  | user_id | url                                            |
+-----+---------+------------------------------------------------+
|   1 |       1 | http://www.site1.com                           |
|   2 |       2 | http://www.site2.com                           |
|   3 |       3 | http://www.site3.com                           |
+-----+---------+------------------------------------------------+
Run Code Online (Sandbox Code Playgroud)

网页

+-------+------------+--------------------------------------+---------------------+
| id    | website_id | url                                  | last_scan_date      |
+-------+------------+--------------------------------------+---------------------+
| 1     |          1 …
Run Code Online (Sandbox Code Playgroud)

mysql limit

1
推荐指数
1
解决办法
437
查看次数