Am trying to add required to an input element in my form.
However, the form is dynamic.If I put the element manually in the page it 
works,but if i use the $compile it doesn't work.

My Html:

  <div style="padding-left:20px; padding-right:20px">
    <ng-form name="Myform">
                    <div id="appendHere"></div>
                    <button   type="submit" ng-disabled="Myform.$invalid"  
class="btn btn-primary">Save</button>

My Controlles js:

   'use strict';
    myapp.controller("CompileController", ["$scope", "$compile", 
        function ($scope, $compile) {
     var $result = $("<ng-form name='form'><div 
class='form-group'><h5><label class='col-xs-2 col-form-label'>Absence 
Status</label></h5><div class='col-xs-10'><input class='form-control' 
required  name='AbsenceStatus' type='text' 

Any help would be highly appreciated. I am using angularjs 1.5.8.


You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to