小编Jus*_*ong的帖子

如何动态添加输入表单?

我想在单击"New Item"时动态添加输入表单.但是真的不知道如何在js部分编写代码.任何的想法?

这是我的代码:

<!doctype html>
<html ng-app>
  <head>
    <title>Angular - My Notes</title>
    <link rel="stylesheet" type="text/css" href="css/index.css">

  <body>
    <h1>My Notes</h1>
    <div ng-controller="Note">
      <input type="text" placeholder="Question">
      <input ng-class="{'blockInput': !inlineChecked}" type="text" placeholder="enter text...">
      <input type="checkbox" name="check" value="inline" ng-model="inlineChecked"> Inline
      <br>
      <button ng-click="add()">New Item</button>
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>
    <script type="text/javascript">

      var Note = function($scope){
        // create a variable contain new input forms?? 
      }


    </script>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

angularjs

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

如何将文本输出到资源文件夹Maven中的文件

这是我的maven项目的结构:

main和test文件夹在src文件夹下,java和resources文件夹在main文件夹下,在resources文件夹中,有一个csv文件可供读取.

src  
  --main  
    |-- java  
    |-- resources  
           |-- test.csv
test  
Run Code Online (Sandbox Code Playgroud)

目前,我正在尝试使用supercsv库覆盖test.csv文件.

我知道这种public CsvMapWriter(Writer writer, CsvPreference preference)方法对此很有帮助.

所以,我正在尝试使用OutputStreamWriter,但是如何访问该文件就像使用:

 InputStreamReader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream("acacia_implexa.csv"));
 mapReader = new CsvMapReader(reader, CsvPreference.STANDARD_PREFERENCE);
Run Code Online (Sandbox Code Playgroud)

java csv maven

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

WooCommerce在列表中添加类名

目前,我正在尝试自定义覆盖WooCommerce.php文件.现在,在这个文件中,

<section id="content woocommerce" class="grid-block woocommerce">
<ul id="products" class="subcategory-products products">
<?php woocommerce_content(); ?>
</ul>
</section>
Run Code Online (Sandbox Code Playgroud)

输出如下:

<li class="post-15 product type-product status-publish hentry first instock">
    <a href="http://shop.bbpixelz.dk/product/i-phone-ai-template/">
        <img width="150" height="150" src="http://shop.bbpixelz.dk/wp-content/uploads/2014/01/iphone-ai-template-150x150.png" class="attachment-shop_catalog wp-post-image" alt="iphone-ai-template">
        <h3>I-Phone Vector Template</h3>
    <span class="price"><span class="amount">$2</span></span>
    </a>
    <a href="/?add-to-cart=15" rel="nofollow" data-product_id="15" data-product_sku="ai-iphone" class="add_to_cart_button button product_type_simple">Add to cart</a>
</li>
Run Code Online (Sandbox Code Playgroud)

我想要做的是更改类名,目前是类名post-15 product ....我想将类名更改为产品类别.

有人能帮助我吗?

php wordpress woocommerce

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

angularjs bootstrap popover数据绑定无法正常工作

目前,我正在尝试使angularjs popover数据绑定工作.

这是html部分:

<div id="sortable" ng-repeat="object in arrayForShow">
   <div ng-class="classGenerate(object)" class="well nomargin" id="resizable" pop-over-width-offset argument='object'>
       {{object.default}}
   </div>
</div>
Run Code Online (Sandbox Code Playgroud)

现在:ng-repeat item:将对象传递给指令pop-over-width-offset.

在popOverWidthOffset指令中: 我正在尝试使模板html能够访问**参数(我在指令的范围中设置).**

app.directive "popOverWidthOffset", ($templateCache)->
    restrict: 'A',
    controller: 'CustomiseFormCtrl'
    scope: {
        argument: '='
    }
    link: (scope, element, attrs)->
        popOverContent = $templateCache.get('angular/templates/popOverCustomisationChangeWidthOffset.html')
        options = {
            content: popOverContent,
            placement: "top",
            html: true,
        }
        $(element).popover(options)
Run Code Online (Sandbox Code Playgroud)

popOverCustomisationChangeWidthOffset.html:

<form>
    {{argument}}
</form>
Run Code Online (Sandbox Code Playgroud)

angularjs

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

AngularJs如何在本地服务器上运行angularjs?和未捕获的错误:[$ injector:modulerr]

我正在尝试编写一个小型Web应用程序:列出用户名和编号

这些文件位于同一文件夹中,例如:

ang8
  |----  index.html
  |----  list.html
  |----  contacts.js   
Run Code Online (Sandbox Code Playgroud)

当我尝试打开index.html时,它不会加载list.html中的内容.任何的想法??谢谢!

index.html代码是:

<!DOCTYPE html>
<html ng-app="contacts">
    <meta character="utf-8">
    <title>Contacts</title>
    <style type="text/css">
        * { box-sizing: border-box; }
        body { font: 14px/1.5 sans-serif; color: #222; margin: 3em;}
    </style>

    <div ng-controller="Contacts">
        <h1>Contacts</h1>
        <div ng-view></div>
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script>
    <script src="contacts.js"></script>
</html>
Run Code Online (Sandbox Code Playgroud)

list.html代码:

<h2>List</h2>
<div>
    <label>search: </label><input type="search" ng-model="search">
    <br>
</div>
<ul>
    <li ng-repeat="contact in contacts | filter:search">
        <a href="#/contact/{{$index}}">{{contact.name}}</a>
        : {{contact.number}}
    </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

和js代码:

angular
    .module('contacts', [])
    .config(function ($routeProvider) {
        $routeProvider
            .when('/', {
                templateUrl: 'list.html' …
Run Code Online (Sandbox Code Playgroud)

angularjs

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

标签 统计

angularjs ×3

csv ×1

java ×1

maven ×1

php ×1

woocommerce ×1

wordpress ×1