Below is my AngularJS code where I am incorporating the DateRangePicker library:
var inApp = angular.module('myApp', ['daterangepicker']);
inApp.controller('incomeController', function($scope, $http) {
console.log('income controller');
$scope.datePicker = { date: {startDate: null, endDate: null} };
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-daterangepicker/3.0.5/daterangepicker.js"></script>
<script src="https://raw.githubusercontent.com/fragaria/angular-daterangepicker/master/js/angular-daterangepicker.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-daterangepicker/3.0.5/daterangepicker.css" />
<div ng-app="myApp" ng-controller="incomeController">
<div class="form-group">
<label for="optsCustom" class="control-label">Select Date</label>
<div>
<input date-range-picker class="form-control date-picker" type="text" ng-model="datePicker.date" />
</div>
</div>
</div>
The error message I am encountering is as follows:
angular.js:14642 TypeError: r.daterangepicker is not a function
at h (angular-daterangepicker.min.js:1)
at angular-daterangepicker.min.js:1
at Scope.$digest (angular.js:18210)
at Scope.$apply (angular.js:18480)
at done (angular.js:12501)
at completeRequest (angular.js:12727)
at XMLHttpRequest.requestLoaded (angular.js:12655)
What would be the best way to resolve this issue?