I have a footerController and codeScannerController with different views.
(我有一个footerController和codeScannerController具有不同的视图。)
angular.module('myApp').controller('footerController', ["$scope", function($scope) {}]);
angular.module('myApp').controller('codeScannerController', ["$scope", function($scope) {
console.log("start");
$scope.startScanner = function(){...
When I click on a <li>
in footer.html I should get this event in codeScannerController.
(当我点击footer.html中的<li>
,我应该在codeScannerController中获取此事件。)
<li class="button" ng-click="startScanner()">3</li>
I think it can be realised with $on
and $broadcast
, but I don't know how and can't find examples anywhere.
(我认为它可以通过$on
和$broadcast
来实现,但我不知道怎样也无法在任何地方找到示例。)