Windows 下挂载EFI分区

以管理员身份运行cmd, 输入:

diskpart
list disk
sel disk x
list part
sel part x //ESP分区
ass //挂载并分配盘符

接下来管理员权限运行编辑器就可以打开分区目录进行修改了。

[AngularJS] ngMesages

关于 ngMessages 官方文档地址 在这里,可是却非常不详细,只列出了三种情况requiredminlengthmaxlength.
如果在 element 里写了自己定义的规则 ng-pattern,需要给出当正则生效时给出的 ngMessage,就需要这样写:

<form name="myForm">
  <label>
    <input name="myField"
            type="text"
            ng-model="myName"
            ng-pattern="/{expression}/"
            />
    </label>
  <div ng-messages="myForm.myField.$error">
    <div ng-message="minlength">...</div>
    <div ng-message="pattern">...</div>
  </div>
&lt;/form&gt;`</pre>

一种调试的方法:

<pre>`&lt;pre&gt;{{myForm.myField.$error}}&lt;/pre&gt;
//错误内容形式:{ "pattern": true }

这样的话直观地看到错误内容,相应的指定错误消息了

参考内容:
Easy Form Validation in AngularJS with ngMessages
ngMessages revisited

JSON数据遍历,并转变形式输出

代码如下:

var originParameters = {
      "5": {
          "4": 5,
          "5": "1",
          "6": "1",
          "10": "1"
      }
};

var arr = originParameters[5];
console.log(arr);
console.log("------");
var FieldParameters = [];
for (var i in arr){
  var  temp  =  {};
  temp.FieldParameterId = i;
  temp.value = arr[i];
  FieldParameters.push(temp);
}
console.log(FieldParameters);
console.log("------");
//console.log(JSON.stringify(FieldParameters));
console.log("------");

var $scope = {};
$scope.formData = {};
$scope.formData.AttributeParameters = FieldParameters;
console.log($scope.formData);

输出结果如下:
Output

Homestead 配置文件设置

内容如下,主要是共享目录的挂载:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: D:/projects/stuTrac
      to: /home/vagrant/Code

    - map: D:/projects
      to: /home/projects

sites:
    - map: homestead.app
      to: /home/vagrant/Code/public

databases:
    - homestead