0

I need use jQuery UI Datepicker in my Angular application, but I wan't create a new directive for this, I just want execute $(".dateInput").datepicker(); after Angular render

How to can I do this?

Lai32290
  • 8,062
  • 19
  • 65
  • 99
  • Possible duplicate of [AngularJS: How to run additional code after AngularJS has rendered a template?](http://stackoverflow.com/questions/12304291/angularjs-how-to-run-additional-code-after-angularjs-has-rendered-a-template) – Meiko Rachimow Mar 09 '16 at 21:55

1 Answers1

0

I found solution! using $timeout, fallowing my code:

var app = angular.module("myApp", []);
app.controller("myCtrl", ["$scope", "$timeout", function ($scope, $timeout) {
    $timeout(function () {
        $("[name=data]").datepicker();
    });
}]);
Lai32290
  • 8,062
  • 19
  • 65
  • 99