Fixed most of the remaining issues with validation

This commit is contained in:
Shannon
2013-08-08 15:13:03 +10:00
parent 918366ef25
commit 8d8d62c3bc
7 changed files with 17 additions and 16 deletions

View File

@@ -7,8 +7,8 @@
var values = [];
//this will be comma delimited
if ($scope.model && $scope.model.value && (typeof $scope.model.value == "string")) {
var splitVals = $scope.model.value.split(",");
if ($scope.value && (typeof $scope.value == "string")) {
var splitVals = $scope.value.split(",");
//set the values of our object
for (var i = 0; i < splitVals.length; i++) {
values.push({
@@ -35,7 +35,7 @@
csv.push(newValue[v].value);
}
//write the csv value back to the property
$scope.model.value = csv.join();
$scope.value = csv.join();
}, true);
};

View File

@@ -11,5 +11,5 @@
</ng-form>
</div>
<span>{{model.value}}</span>
<span>{{value}}</span>
</div>

View File

@@ -1,10 +1,10 @@
<div ng-controller="MyPackage.PropertyEditors.PostcodeEditor">
<p>
Enter a postcode for country <span>{{model.config.country}}</span>
Enter a postcode for country <span>{{config.country}}</span>
</p>
<input name="myPackage_postcode" type="text" ng-model="model.value"
<input name="myPackage_postcode" type="text" ng-model="value"
val-server="value"
val-postcode="model.config.country"/>
val-postcode="config.country"/>
<span class="help-inline" val-msg-for="myPackage_postcode" val-toggle-msg="valServer">{{propertyForm.myPackage_postcode.errorMsg}}</span>
<span class="help-inline" val-msg-for="myPackage_postcode" val-toggle-msg="valPostcode">{{propertyForm.myPackage_postcode.errorMsg}}</span>

View File

@@ -1,12 +1,12 @@
<div ng-controller="MyPackage.PropertyEditors.RegexEditor">
<p>
Value in the format of <span>{{model.config}}</span>
Value in the format of <span>{{config}}</span>
</p>
<input name="regex" id="regex"
type="text" ng-model="model.value"
type="text" ng-model="value"
required
val-regex="model.config"
val-regex="config"
val-server="value" />
<span class="help-inline" val-msg-for="regex" val-toggle-msg="required">Required!</span>