Quote:
1)What is the use of require attribute?
The require attribute will try to access another directive called (in your case) ngModel.
Quote:
2)When should I use 'A','E' for restrict option?(For ex datepicker)
This restricts the use of a your directive to a specific method of using it.
A = attribute. So something like <span datetimepicker=""></span>
E = Element. So something like <datetimepicker>
C = Class. So something like <span class="datetimepicker"></span>
M = Comment. So it would be something like <!--directive:datetimepicker-->
I don't think you can use both AE for creating a directing but Im not 100% on that.
Quote:
3)What is the difference between compile & link function?
For this I would direct you to this link for an explanation:
javascript - What is the difference between compile and link function in angularjs - Stack Overflow[
^]
Then as for your request for someone to provide you step by step instructions for creating a date picker directive, I'd direct you to use google. This is beyond the scope of Quick Answers and isn't meant to provide tutorials.
Here are some promising links:
angularjs-datepicker[
^]
javascript - AngularJS custom datepicker directive - Stack Overflow[
^]
GitHub - g00fy-/angular-datepicker: calendar and datepicker directives for angular[
^]
[
Material Angular Js - DatePicker]
I'd also recommend you take a look at the Directive documentation for angular:
[
Angular JS Directive]