GIS-项目总结

GIS项目主要用的是Flatify框架,能很好的和bootstrap,UIbootstrap,AngularJS结合起来使用.

网站学习:

  1. 可以打印出漂亮的可折叠的josn格式插件(需要引用js,还有依赖项):http://azimi.me/json-formatter/demo/demo.html

  2. 基于h5的拖拽效果插件(需要引用js,还有依赖项):https://github.com/marceljuenemann/angular-drag-and-drop-lists

  3. 也是拖拽排序效果并支持触屏(需要引用js,还有依赖项):https://github.com/a5hik/ng-sortable;
  4. 齐全的angular-filter(学习):https://github.com/a8m/angular-filter

  5. encodeURIComponent():将字符串转换成url识别的编码;eg:encodeURIComponent(angular.toJson(exportExcel));

  6. 图表:https://github.com/develersrl/angular-flot由于flatify这个框架中的图表可能有点bug,不支持动态生成,所以找的这个库;

学到的一些简单用法:

  • filter的unique用法:可以根据数组中键名称筛选出整个数组中此键不重复的对象组成的数组:$filter('unique')(data,'groupname');【max用法于此类似】
  • copy:angular.copy($scope.all,$scope.empty);此方法与直接等于有点区别,我的理解,等于,两者的值会相互改变影响,copy不会;
  • 对象循环:angular.forEach(object,function(val,key){})
  • 本地删除数组中的对象:
    var index=$scope.mp.indexOf(item);
    if(index!=-1){
    $scope.mp.splice(index,1);
    }
  • 删除对象中的变量:delete data.create;
  • 在angularJs里的页面跳转用$location.path('/#xxx');ionic中的页面跳转用state.go();
  • 页面跳转:当前页面使用$location.path()时候里边是没有参数的;
  • concat()方法数组连接;
  • $scope.$on/$emit(上级)/$broadast(下级);
  • array.join(',');array是字符串数组,join()可以使字符串数组转化为字符串并用','连接起来;
  • array=$filter('map')(array,fieldName);将对象数组filter为字符串数组;

遇到的错误提示:

  1. track by问题:
posted @ 2016-02-25 13:55  白洋花海  阅读(269)  评论(0编辑  收藏  举报