zoukankan      html  css  js  c++  java
  • Angular.js入门

    一、引入angular.js

         <script type="text/javascript" src="../plugins/angularjs/angular.min.js"></script>

    二、定义控制器、模块

        

    <script type="text/javascript">
            var app = angular.module('eshop',[]);
            app.controller('brandController',function($scope,$http){
                //获取查询数据
                $scope.findAll= function(){
                    $http.get('../brand/getAllBrand.do').success(
                        function(res){
                            $scope.list = res;
                        }        
                    )
                }
            });
        </script>

    三、在body标签中引入变量

    <body class="hold-transition skin-red sidebar-mini" ng-app="eshop" ng-controller="brandController" ng-init="findAll()">

    四、在对应的列表中显示

                                      <tbody>
                                          <tr ng-repeat="entity in list">
                                              <td><input  type="checkbox" ></td>                                          
                                              <td>{{entity.id}}</td>
                                              <td>{{entity.name}}</td>                                         
                                              <td>{{entity.firstChar}}</td>                                         
                                              <td class="text-center">                                           
                                                   <button type="button" class="btn bg-olive btn-xs" data-toggle="modal" data-target="#editModal"  >修改</button>                                           
                                              </td>
                                          </tr>
                                      </tbody>



  • 相关阅读:
    SQL INNER JOIN
    SQL JOIN
    SQL OUTER JOIN
    SQL CROSS JOIN
    SQL 基础:Select语句,各种join,union用法
    Morton Code
    vs 字体
    sql 语言
    sqllite3
    linux怎么区别文本文件和二进制文件
  • 原文地址:https://www.cnblogs.com/flgb/p/10171543.html
Copyright © 2011-2022 走看看