angular-data

码农软件 · 软件分类 · AngularJS 扩展 · 2019-03-17 11:41:59

软件介绍

angular-data 是 AngularJS 的一个扩展,实现了数据存储和缓存的功能。

示例代码:

var app = angular.module('myApp', ['angular-data.DS']);
app.factory('User', function (DS) {
  // Simplest resource definition
  return DS.defineResource('user');
});
app.controller('friendsCtrl', function ($scope, $routeParams, User) {
  // it's up to your server to know how to interpret this query
  // or you can teach angular-data how to understand your servers' query language
  var query = {
    where: {
      friendIds: {
        in: $routeParams.id
      }
    }
  };
  
  User.find($routeParams.id);
  User.findAll(query);
  
  // My goodness this was easy
  User.bindOne($scope, 'me', $routeParams.id);
  User.bindAll($scope, 'friends', query);
  
  // Long form
  $scope.$watch(function () {
    return User.lastModified($routeParams.id);
  }, function () {
    $scope.me = User.get($routeParams.id);
  });
  $scope.$watch(function () {
    // Changes when anything in the User collection is modified
    return User.lastModified();
  }, function () {
    $scope.friends = User.filter(query);
  });
});

本文地址:https://codercto.com/soft/d/1538.html

算法设计与应用

算法设计与应用

迈克尔 T. 古德里奇(Michael T. Goodrich)、罗伯特·塔马契亚(Roberto Tamas / 乔海燕、李悫炜、王烁程 / 机械工业出版社 / 2017-11-20 / CNY 139.00

本书全面系统地介绍算法设计和算法应用的各个领域,内容涵盖经典数据结构、经典算法、算法分析方法、算法设计方法以及算法在各个领域的应用,还包含一些高级主题。本书采用应用驱动的方法引入各章内容,内容编排清晰合理,讲解由浅入深。此外,各章都附有巩固练习、创新练习和应用练习三种类型的题目,为读者理解和掌握算法设计和应用提供了很好的素材。 本书可作为高等院校计算机及相关专业“数据结构和算法”课程的本科生......一起来看看 《算法设计与应用》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具