Hello,
This is related to topic Different header buttons
This works although a bit of work if you have multiple pages needing different buttons in the header.
How do you call a function in a page from a button in the header?
This is how I do it now:
Add a button and function in the header of the index page and add a broadcast in this function:
code
$scope.$broadcast('page1Event', {"a": 1, "b": 2});
/code
In page1 I add this to the init function:
code
$scope.headerButtons.showPage1Btn = true;
$scope.$on('page1Event', $scope.myFunc);
/code
and create function myFunc in page1:
code
$scope.myFunc = function (event, args) {
console.log('myFunc');
console.log(event);
console.log(args);
}
/code
This is all working. But when you have multiple pages and need multiple buttons in the header I think this is quite cumbersome.
Question is: will the Ionic header and footer component ever be supported which I think will be easier to work with?
Ionic header component
How are other developers doing this?