简体   繁体   English

如何使用angularjs在页面加载中调用datepicker jQuery插件

[英]How to call datepicker Jquery plugin in Page onload using angularjs

I have a jquery plugin, I want to call this on page onload event. 我有一个jquery插件,我想在页面onload事件中调用它。 I have tried with below code. 我试过下面的代码。 someone help me on this. 有人帮助我。 Thanks. 谢谢。

    var app = angular.module("myApp", []);
    app.controller('MyCtrl', ['$scope', '$http', function ($scope, $http) {

        app.element(document).ready(function () {
            document.getElementById("#req_date").glDatePicker();
        });

        $scope.AddCrims = function () {

            alert('hi');
        }
    }]);

It should be angular not app : 它应该是有angular而不是app

angular.element(document).ready(function () {
    document.getElementById("#req_date").glDatePicker();
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM