I have a search input field and i am trying to send that input to a JavaScript variable that i'd like to use. this is in Angular
input
<input ng-model="searchText" placeholder="Search">
controller.js
angular.module('searchkingApp')
.controller('MainCtrl', function($scope){
//which code can i put under here?
//and end up having
var searchedItem = //the string I have searched for..
I have the JavaScript file located in a different place from the HTML file.
Thanks alot in advance.