angularjs-bindings

How to validate form in AngularJS 1.x component

删除回忆录丶 提交于 2020-02-04 11:43:46
问题 I have a form that its fields are inside the component. Now I want to validate the fields. The problem is, my messages don't show up. also the pattern doesn't have any effects. I tried to fix it with help of this post, but no success. Does someone have any idea how can I show my messages? index.html <form name="dataForm"> <md-tabs> <valid-data form-reference="dataForm"></valid-data> </md-tabs> <div> <md-button type="submit" ng-click="vm.save()"> Save </md-button> </div> </form> component.html

Broadcast not received in directive

瘦欲@ 提交于 2019-12-12 13:35:05
问题 I have a parent-child controller relationship between my <main> , <div> and <my-directive> as such: <main ng-controller="MainController"> <nav> <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> </nav> <div ng-controller="AboutController"> </div> <my-directive></my-directive> </main> Within the MainController, i perform a $broadcast with a: $scope.$broadcast('shoppingCartReady', msg); Within AboutController, i can successfully receieve this $broadcast via: angular.module('aboutModule', []

AngularJS 1.3 pattern validation binding not working

﹥>﹥吖頭↗ 提交于 2019-12-12 05:00:00
问题 I have been using Regex pattern validation with AngularJS for the last several versions and it has worked fine. My application requires that validation patterns are exposed by a scope property, to which the corresponding AngularJS validation directive is bound. Prior to v1.3, it looked something like this: // On the controller $scope.validationPattern = "^\\d*$"; // Allow only numeric digits <!-- in the HTML page ---> <input type="text" name="age" ng-pattern="/{{validationPattern}}/" />