How to transition from jQuery to AngularJS: thinking in a new way
Hello everyone! I'm a beginner frontend developer and I have a serious problem. I've been writing in jQuery for a long time, and now I'm trying to learn AngularJS, but my brain just refuses to adapt.
In jQuery, I'm used to doing everything manually: find an element via $('selector'), attach a handler, modify the DOM directly. For example, to update a list, I write:
```javascript
// jQuery style
$('#loadBtn').on('click', function() {
$.get('/api/items', function(data) {
var list = $('#itemList');
list.empty();
data.forEach(function(item) {
list.append('' + item.name + ' ');
});
});
});
```
In AngularJS, I try to do the same thing, but it turns into a mess of $scope, directives, and services. I constantly catch myself thinking: "Where do I get this element? How do I bind