I am currently learning angularJS and although it would be simpler to use JQuery for this task, I am determined to do it the right way.
Essentially, I want to create a text input field where users can type in a search term, press a search button, and then use Ajax to search for and display the results in a list.
I believe I need to utilize directives to achieve this, is that correct?
I am not asking for someone to do this for me, but rather to provide some guidance or examples so I can create it myself.
MY DIRECTIVE (IN PROGRESS)
app.directive('recordSearch', function() {
return {
restrict: 'E',
scope: {
searchInfo: '=info'
},
templateUrl: 'partials/record-search.html',
link: function(scope, element, attr) {
}
};
});
RECORD-SEARCH.HTML
<label class="item item-input">
<span class="input-label">{{ searchInfo.title }}</span>
<i class="icon ion-search placeholder-icon"></i>
<input type="search">
</label>
ON MY ACTUAL PAGE
<record-search info="company"></record-search>