Meteor check
C:\Users\Administrator\Desktop\meteorApp>meteor add check
使用check
在我们的下一个例子中,检查 myValue 的值是否是字符串类型。因为它是 true ,应用程序将继续没有任何错误。
meteorApp/client/app.js
var myValue = 'My Value...';
check(myValue, String);
meteorApp/client/app.js
var myValue = 1;
check(myValue, String);
Match.test 功能类似于 check. 所不同的是在测试失败时,我们将得到控制台错误的值而不会破坏该服务器。下面的例子显示了如何使用多个键进行测试对象。
meteorApp/client/app.js
var myObject = {
key1 : "Value 1...",
key2 : "Value 2..."
} var myTest = Match.test(myObject, {
key1: String,
key2: String
}); if ( myTest ) {
console.log("Test is TRUE...");
} else {
console.log("Test is FALSE...");
}

meteorApp/client/app.js
var myObject = {
key1 : "Value 1...",
key2 : 1
} var myValue = 1; var myTest = Match.test(myObject, {
key1: String,
key2: String
}); if ( myTest ) {
console.log("Test is TRUE...");
} else {
console.log("Test is FALSE...");
}
Meteor check的更多相关文章
- Using View and Data API with Meteor
By Daniel Du I have been studying Meteor these days, and find that Meteor is really a mind-blowing f ...
- Meteor+AngularJS:超快速Web开发
为了更好地描述Meteor和AngularJS为什么值得一谈,我先从个人角度来回顾一下这三年来WEB开发的变化: 三年前,我已经开始尝试前后端分离,后端使用php的轻量业务逻辑框架.但 ...
- meteor报错之:MongoDB had an unspecified uncaught exception.
今天测试的时候meteor报了个错 如下: MongoDB had an unspecified uncaught exception. This can be caused by MongoDB b ...
- Use Node.js DDP Client on Arduino Yun to Access Meteor Server
Use Node.js DDP Client on Arduino Yun to Access Meteor Server 概述 在Arduino Yun上安装 Node.js, 并測试与 Meteo ...
- BFS搜索:POJ No 3669 Meteor Shower
#include <iostream> #include <cstring> #include <queue> #include <cstdio> #i ...
- Meteor ToDo App实例
在本章中,我们将创建一个简单的待办事项应用程序. 第1步 - 创建应用程序 打开命令提示符,运行以下命令 - C:\Users\Administrator\Desktop>meteor crea ...
- POJ3669 Meteor Shower
http://poj.org/problem?id=3669 类似于迷宫的一道题 但是并没有 给出迷宫具体什么样 但是题目已说在坐标轴的第一象限 然后障碍就是 流星雨所砸范围 安全位置:永远不会发生危 ...
- POJ 3669 Meteor Shower BFS求最小时间
Meteor Shower Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 31358 Accepted: 8064 De ...
- 【译】Meteor 新手教程:在排行榜上添加新特性
原文:http://danneu.com/posts/6-meteor-tutorial-for-fellow-noobs-adding-features-to-the-leaderboard-dem ...
随机推荐
- mybatis获取存储过程返回结果
获取存储过程返回结果 代码: // Map<String,Object> map = new HashMap<String,Object>(); map.put("i ...
- 将自己的数据制作成voc格式
VOCdevkit2007文件下只保存VOC2007,VOC2007下只保存Annotations ImageSets JPEGImages. JPEGImages存放所有的图片数据(即训练测试验证的 ...
- Spring框架针对dao层的jdbcTemplate操作crud之update修改数据库操作
使用jdbcTemplate 原理是把加载驱动Class.forName("com.mysql.jdbc.Driver"); 和连接数据库Connection conn=Drive ...
- [CF] 950B Intercepted Message
B. Intercepted Message time limit per test1 second memory limit per test512 megabytes inputstandard ...
- webpack之source map
先来一个webpack小例子,项目结构如下: // greeter.js module.exports = function() { var greet = document.createElemen ...
- Binlog详解
一.介绍 binlog, 即二进制文件,他记录了MySQL所有数据的变更,并以二进制的形式存储在磁盘上 二.binlog模式 binlog有三种模式:ROW(行模式), Statement(语句模 ...
- PAT 1027. 打印沙漏
打印沙漏 本题要求你写个程序把给定的符号打印成沙漏的形状.例如给定17个"*",要求按下列格式打印 ***** *** * *** ***** 所谓"沙漏形状" ...
- 大数据学习——hive使用
Hive交互shell bin/hive Hive JDBC服务 hive也可以启动为一个服务器,来对外提供 启动方式,(假如是在itcast01上): 启动为前台:bin/hiveserver2 启 ...
- Python+selenium(Autolt实现上传)
AutoIt是一个使用类似BASIC脚本语言的免费软件,被设计用来进行Windows GUI的自动化测试.它利用模拟键盘按键,鼠标移动和窗口/控件的组合来实现自动化任务. 此次小编介绍的是利用Auto ...
- spring boot学习01【搭建环境、创建第一个spring boot项目】
1.给eclipse安装spring boot插件 Eclipse中安装Spring工具套件(STS): Help -> Eclipse Marketplace... 在Search标签或者Po ...