小编mcn*_*a86的帖子

Angular-ui模态 - 将数据传递给模态

我打算在打开时将一些模型数据传递到模态窗口.当用户点击一个元素时,我想让模态窗口打开,并显示与点击内容有关的更多详细信息.

除了将数据传递到模态窗口之外,我已经创建了一个按照我想要的方式工作的plunker.

我试图使用ng-click传递数据:

<img ng-src="{{item.picture}}" width="100" ng-click="open(item)"/>
Run Code Online (Sandbox Code Playgroud)

谁能帮我这个?还是指出我正确的方向?

modal-dialog jquery-isotope angularjs angular-ui

20
推荐指数
2
解决办法
5万
查看次数

Wordpress短代码传递值数组

我正在创建一些WordPress短代码,旨在提供页面上的内部导航(一页有很多内容部分和它自己的菜单).

这就是我所拥有的:

//menu
function internal_menu($atts) {
  extract(shortcode_atts(array(
   'href1' => '#jl1',
   'href2' => '#jl2',
   'href3' => '#jl3',
   'href4' => '#jl4',
  ), $atts));
  return '<div id="internalPageMenu">
    <ul>
        <li><a href="' . $href1 . '"><i class="fa fa-bars"></i>link 1</a></li>
        <li><a href="' . $href2 . '">link 2</a></li>
        <li><a href="' . $href3 . '">link 3</a></li>
        <li><a href="' . $href4 . '">link 4</a></li>
    </ul>
    </div>';
}
add_shortcode('internal-menu', 'internal_menu');

//menu target
function internal_menu_target($atts) {
  extract(shortcode_atts(array(
   'id' => 'jl1',
   'text' => '',
   ), $atts));
   return '<h3 id="' . $id . …
Run Code Online (Sandbox Code Playgroud)

php wordpress shortcode

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

ngCordova谷歌分析($ cordovaGoogleAnalytics)

我正在尝试使用ngCordova 的" https://github.com/danwilson/google-analytics-plugin.git "插件.我添加了插件并在控制器中添加了ngCordova作为依赖项.

当我尝试设置:

$cordovaGoogleAnalytics.startTrackerWithId('UA-XXXXXXXX-X'); 
Run Code Online (Sandbox Code Playgroud)

我收到此错误:'TypeError:无法读取'undefined'属性'startTrackerWithId'.

我已将分析设置为Google信息中心中的移动应用.

任何人都可以帮忙吗?

plugins google-analytics angularjs cordova ionic-framework

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

AngularJs多次ng-click

我试图做以下事情:

<accordion-heading ng-click="doSomething(); isopen=!isopen">
Run Code Online (Sandbox Code Playgroud)

这有用吗?还是不可能把那里的电话串起来?

ng-click="doThis(param); doThat(param);"
Run Code Online (Sandbox Code Playgroud)

我只需指向正确的方向:-)

编辑:

这个:

ng-click="doThis(param); doThat(param);"
Run Code Online (Sandbox Code Playgroud)

按预期工作,我认为是:

isopen=!isopen
Run Code Online (Sandbox Code Playgroud)

这导致了问题,我意识到我最初并没有这么说.

我通过在手风琴标题中添加一个额外的div来解决这个问题,如下所示:

<accordion-heading ng-click="isopen=!isopen">
    <div ng-click="showMainView()">
        <i class="glyphicon" ng-class="{'glyphicon glyphicon-minus': isopen, 'glyphicon glyphicon-plus': !isopen}"></i>
        {{item.model}}<br>{{item.model_engine}}
    </div>
</accordion-heading> 
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-ng-click

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

SailsJS API 文件上传

我正在使用我在这里找到的教程来帮助我找出 SailsJS 中的文件上传。在 Sails 中使用 .ejs 模板引擎时,我已经能够使上传工作,但我需要文件上传才能与 RESTapi 一起使用。我设置的 URL 是“ http://localhost:1337/file/upload ”,我使用 Postman chrome 应用程序将文件发送到服务器,但我得到的响应是:

{
  "status": 200,
  "file": []
}
Run Code Online (Sandbox Code Playgroud)

当不使用 API(在 .ejs 模板中使用)时,我得到以下响应:

{
  "status": 200,
  "file": [
    {
      "fd": "path/to/uploaded/file/.tmp/uploads/assets/images/18c60ef7-b176-4375-8789-e0f80de29cea.pdf",
      "size": 48541,
      "type": "application/pdf",
      "filename": "file.pdf",
      "status": "bufferingOrWriting",
      "field": "uploadFile"
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我不确定问题出在哪里,我没有将文件传递给服务器吗?或者服务器在收到文件后是否没有正确处理文件?

作为参考,这是我的控制器代码:

module.exports = {
    upload: function  (req, res) {
        if(req.method === 'GET')
            return res.json({'status':'GET not allowed'});                      

        var uploadFile = req.file('uploadFile');
        uploadFile.upload({ dirname: 'assets/images'},function onUploadComplete (err, files) {              
            if (err) return …
Run Code Online (Sandbox Code Playgroud)

sails.js postman

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

WordPress 短代码始终位于页面顶部

我有以下短代码,用于在页面上显示自定义帖子:

add_shortcode( 'page-section', 'page_section_shortcode' );
function page_section_shortcode( $atts ) {
    global $post;
    $post_slug=$post->post_name;
    $a = shortcode_atts( array(
        'post-name' => 'qwerty',
        'bg-color' => 'white'
    ), $atts );
    $post_slug=$post->post_name;
    $post_name = $a['post-name'];
    $query = new WP_Query( array(
        'post_type' => 'page_section',
        'name' => $post_name,
    ) );
    if ( $query->have_posts() ) { ?>
        <?php while ( $query->have_posts() ) : $query->the_post(); ?>
            <div style="background-color: <?php echo $a['bg-color']; ?>" id="<?php global $post; $post_slug=$post->post_name; echo $post_slug; ?>" class="page-section">
                <div class="row">
                    <?php the_content(); ?>
                </div>
            </div>
        <?php endwhile; …
Run Code Online (Sandbox Code Playgroud)

wordpress shortcode

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

SailsJS用户访问级别和角色

我正在使用我在这里学到的东西来构建用户身份验证系统.基本上它使用护照本地身份验证.

如何将用户访问级别和角色添加到SailsJS?例如,我想访问级别(canWriteAll,canWriteOwn,canRead)以及分配给它们的用户角色(admin,contributor,user ......等等).

sails.js passport.js

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

Openlayers ol.interaction.Draw 描边样式

我有这个jsfiddle,它能够在完美运行的地图上绘制多边形。我想不通的是如何设置 .Draw 交互的样式。

目前,我有一条虚线用于用户已经绘制的多边形部分,另一条虚线将第一个绘制的点连接到最后一个绘制的点。

当我写样式时,它似乎会影响这两行。

我需要的是一条黑色虚线连接用户已经绘制的点,并且没有线(完全透明)用于将最后绘制的点连接回第一个绘制点的线。

这是我当前的样式对象:

style: new ol.style.Style({
    stroke: new ol.style.Stroke({
      color: 'rgba(0, 0, 0, 0.5)',
      lineDash: [10, 10],
      width: 3
    }),
    image: new ol.style.Circle({
      fill: new ol.style.Fill({ color: [0, 0, 0, 0.2] }),
      stroke: new ol.style.Stroke({
        color: [0, 0, 0, 0.5],
        width: 1
      }),
      radius: 4
    })
  })
Run Code Online (Sandbox Code Playgroud)

我曾尝试添加颜色和样式数组,但似乎无法正常工作。

有没有人遇到过这个问题并找到了解决方法?

openlayers reactjs

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