javascript - Angular - attach directive to future element -
first of all, ery new angular, sorry if question seems strange.
i know how attach basic directives ng-click
elements that:
<button class="test" ng-click="clearoverlays()">remove</button>
but how can attach directive input box dinamically generated django template language ? django code:
<ul>{{ filter.form.as_ul }}</ul>
the future element that:
<input id="id_property_parent" name="property_parent" type="radio" value="12">
so ideal variant if able attach ng-change directive future element it's id ('id_property_parent')
is possible angular js framework ?
ok depends on trying achieve. see 2 different cases, can tell, yours quite simple solve. 2 cases :
- the dynamic piece of html generated django loaded dom via ajax;
- the dynamic piece of html inserted full document before page sent client.
correct me if wrong think case second. in case, thing have add attribute (in case ng-change
) input. when angular parse document, find , compile ng-change
directive without need add other js code.
so basically, question have ask more : "how add custom attribute django's form inputs?"
hope helps
Comments
Post a Comment