json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

How to use custom directive with angular schema form? #777

Closed gaganmalhotra closed 7 years ago

gaganmalhotra commented 7 years ago

I have a custom directive that i want to use it with the date field created by the angular schema form. If you could guide me how to implement it.

I have updated the code with my custom directive to be used in the below plunker, if anyone could help me out on this one. Thanks!

Plunker: https://plnkr.co/edit/30BjICzgFsXlQ3ZgfkUi?p=preview

I want to use the date picker directive to be rendered using the schema form and not by using my custom directive in the html.

Thanks.

Anthropic commented 7 years ago

@gaganmalhotra I'm not sure I follow what you mean, are you saying you want to add the directive, but not create a custom add-on? So leave the template as it is but have it act upon part of the template?

gaganmalhotra commented 7 years ago

I was thinking that without making a directive can we wrap an html template to be rendered using a decorator in the schema form. But i went ahead by making a decorator and it works fine. Thanks :)