Implementation smart filter on angularjs