Arcayne Arcayne - 10 months ago 42
AngularJS Question

How can I write this directive without using element.on - not using jquery

I would like to write this directive without jQuery.

Inpired by this SO question I am trying to get rid of jquery where it is not needed or where I can do it another way . . .

MyApp.directive('myCamera', function () {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attrs, ctrl) {
element.on('click', function() { (imageURI)
scope.$apply(function() {
}, function (err) {
ctrl.$setValidity('error', false);
//Options =>
{ quality: 50,
destinationType: Camera.DestinationType.FILE_URI


Answer Source

To remove the dependency on JQuery, you need to replace




All the documentation for angular's jquery lite implementation is available under