Angular JS - Exposing Controller Function outside the module via onClick function call
Exposing Controller Function outside the module via onClick function call
For re-using already defined onClick functions
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<div ng-app="myapp" ng-controller="mycontroller">
<ul ng-init="friends=[
{name: 'yen', job: 'design'},
{name: 'hung', job: 'deverlop'}
]">
<li ng-repeat="friend in friends | filter:filterKey">
{{friend.name}} like {{friend.job}}</li>
</ul>
search: <input ng-model="filterKey">
</div>
JavaScript
angular.module('myapp', [])
.controller('mycontroller',function($scope) {
});