GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Angular用ng-repeat生成表单并绑定ng-click时的一个细节 · Issue #12 · Wscats/articles

Angular用ng-repeat生成表单并绑定ng-click时的一个细节 #12

New issue
Copy link
New issue
Copy link
Closed
Closed
Angular用ng-repeat生成表单并绑定ng-click时的一个细节#12
Copy link
Labels
notes

Description

@Wscats
Wscats
opened on May 7, 2016
Issue body actions

偶然发现一个问题是ng-repeat里面生成的DOM并绑定ng-click的时候,时间cardshow写法是正确可运行的,但是一旦写成cardShow就会报错,这点试错了很久才发现,记下来防止后人踩坑,看到的就留意一下这个地方,避免困扰了,貌似驼峰写法是不支持的,不知道是否姿势不对哈哈~

$scope.cardshow = function(e){
    console.log(e);
    console.log("测试一下");

}
$scope.cardShow = function(e){
    console.log(e);
    console.log("测试一下");

}
<table class="table table-striped" style="font-weight:normal;">
                        <tr value='{{cardShows}}' class="{{cardShows.length==0&&cardShows?'ng-hide':'ng-show'}}">
                            <th style="font-weight:normal;">名字</th>
                            <th style="font-weight:normal;">价格</th>
                            <th style="font-weight:normal;">操作</th>
                        </tr>
                        <tr ng-repeat="cardShow in cardShows">
                            <!--<th>{{cardShow.card_id}}</th>-->
                            <td style="font-weight:normal;">{{cardShow.card_name}}</td>
                            <td style="font-weight:normal;">¥{{cardShow.price}}</td>
                            <td style="font-weight:normal;"><div style="margin: 0; padding: 0;" class="btn btn-primary" type="button" value="删除" ng-click="cardshow(cardShow)">删除</div></td>
                        </tr>
                    </table>
    </div>

Activity

  1. Wscats
    changed the title [-]Angular用ng-repeat生成表单的一个细节[/-] [+]Angular用ng-repeat生成表单并绑定ng-click时的一个细节[/+] on May 7, 2016
  2. Wscats
    added
    notes
    on May 7, 2016
  3. Wscats
    closed this as completedon Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    notes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.