0
これは私のイオンポップオーバースクリプトです:イオンポップオーバーで関数を書くには?
$scope.popover = $ionicPopover.fromTemplateUrl('templates/demo.html', {
scope: $scope,
controller: [$scope,function($scope){
$scope.savePost=function(){
console.log ($scope.$scope.savePost)
}
}]
}).then(function(popover){
$scope.popover = popover;
})
と、これは私のdemo.html
<ion-popover-view>
<ion-content>
<div class="list">
<button class="item" ng-click=savePost()>Save</button>
</div>
</ion-content>
</ion-popover-view>
ですが、私はコード内でこの機能を入れたいが、私はそれをどこに置くかを確認していません。
$scope.savePost=function(){
//do something
console.log ('this is the save post function)
}
は非常にあなたがupvoteすることができます – noor
をお願いします。 – Nere
ありがとうございました。あなたは大歓迎です。 – Nere