When it comes to Angular, I've come across directives being written in two different ways:
.directive('example', function () {
// Implementation
});
.directive('example', function factory() {
// Implementation
})
Can you explain the difference between these two approaches?