小编Asu*_*osh的帖子

grpc和express服务器可以在同一个nodejs服务器上运行吗,或者grpc必须是不同的服务器

我正在尝试创建一个基于 Node/Express 的 REST 服务器。如何在同一个 REST 服务器中添加 GRPC 服务器,或者它必须是完全不同的仅托管 GRPC 服务器的 NodeJS 服务器。

javascript node.js express grpc grpc-node

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

使用HTML5和AngularJS拖动表列

http://jsfiddle.net/asutosh/82qum/

<div ng-app='myApp'>

 <div ng-controller="myCtrl">


<table border="4">
    <thead>
        <th ng-repeat="hd in heads">
            <div draganddrop drag="handleDrag()">{{hd}}</div>
        </th>
        </thead>
        <tr ng-repeat="row in myData">
        <td ng-repeat="hd in heads">
        {{row[hd]}}
        </td>
        </tr>

</table>
</div>
Run Code Online (Sandbox Code Playgroud)

这是JS:

  var myApp=angular.module('myApp',[]);
  myApp.controller('myCtrl',function($scope){
  $scope.handleDrag=function()
     {

     }


   $scope.heads=['name','age','company','tech'];

   $scope.myData=[{name:'Jay',age:27,company:'XYZ',tech:'Js'},
            { name:'Rayn',age:30,company:'XYZ',tech:'.net'}]    
   });
    myApp.directive('draganddrop',function(){
    return{
    scope:{
        drag:'&'
    },  
    link: function(scope, element) {
    // this gives us the native JS object
    var el = element[0];
     el.draggable=true;

    el.addEventListener(
        'dragstart',
        function(e) {


    e.dataTransfer.effectAllowed = 'move';

           // this.classList.add('drag');
            return false;
        },
        false
    );

    el.addEventListener(
        'dragend', …
Run Code Online (Sandbox Code Playgroud)

angularjs html5-draggable

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