angularjs - validation directive with a small red strip at right or left side inside textbox -
I am making verification instructions with the NG-model.
Target: If the model is empty, empty or undefined, then it will give a small red strip inside the special text box.
Even I have done so far ... in my example, it converts the entire background to red when I left only a small red bar on the left or right side of the text Want in the box ..
Illusion: I do not know how to create CSS that will only generate a small red bar within the textbox
. CSS
.require {background: red; }
.html
.js
var app = angular Module ('app', []); App.directive ("nxRequired", function () {return: "a", required: "ngmodel", scope: {ngModel: "="}, link: function (scope, atr, amm) {scope. ("Ngmodel", function (newville, oldwail) {debugger if (newewell! = Undefined and newell! = "") {Elem. $ RemoveClass ("required");} Other {AMM $ addClass ("requirement");} });}};});
If I think your question is correct ...
Change:
.require {background: red; }
From:
.require {border-style: solid; Border-left: 2px solid red; }
Comments
Post a Comment