2017-08-01 8 views
0

イオンバージョン1の作業を開始し、モーダルを開くためのコードを追加しましたが、モーダルを開くことはできません。それは私にこのエラーを与えています: - "リソースを読み込めませんでした:net :: ERR_FILE_NOT_FOUND"。 - :私は私のWWW /ページ/モーダル/ MEMBERID/memberid.htmlフォルダ内のHTMLファイルを作成しているイオンモーダルポップアップが機能しない

// Load the modal from the given template URL 
     $ionicModal.fromTemplateUrl('pages/modal/memberid/memberid.html', { 
     scope: $scope, 
     animation: 'slide-in-up' 
    }).then(function(modal) { 
     $scope.modal = modal; 
    }); 

    $scope.openModal = function() { 
     $scope.modal.show(); 
    }; 

    $scope.closeModal = function() { 
     $scope.modal.hide(); 
    }; 

    //Cleanup the modal when we're done with it! 
    $scope.$on('$destroy', function() { 
     $scope.modal.remove(); 
    }); 

    // Execute action on hide modal 
    $scope.$on('modal.hidden', function() { 
     // Execute action 
    }); 

    // Execute action on remove modal 
    $scope.$on('modal.removed', function() { 
     // Execute action 
    }); 
    $ionicModal.show(); 

- :以下は私のコードです。見つからないテンプレートファイルに関するエラーを表示しています

答えて

1

指定したファイルパスが正しくない場合は、まずブラウザを使用して解決してください。


代替ソリューションとして、あなたはどこ上記のスクリプトを追加するために、HTML自体

<script id="modal.html" type="text/ng-template">some modal code</script> 

に埋め込まれたテンプレートを使用して、あなたのjavascript

+0

にURLとしてmodal.htmlを使用しようとすることができますか? –

+0

コントローラを指定したhtmlページに追加できます –

関連する問題