AngularJS bootstrap.ui modal not showing right -


i trying display modal dialog using angularjs bootstrap.ui.when $modal.open(...) appears on screen line.before have problem screen grays out (angularjs bootstrap.ui modal not showing solved problem, added new bootstrap css cannot figure out why don't see modal screen. using visual studio 2013, mvc 5, angularjs 1..2. trying follow tutorial: http://angular-ui.github.io/bootstrap/; getting no error reported javascript console. app defined follows:

 var app = angular.module("app", ["nggrid", "ui.bootstrap"]);     app.controller("ctrlcontroller", function ($scope, $http, $log, $modal) {  $scope.on = function () {            ....             var modalinstance=  $modal.open(                 {                     templateurl: 'http://localhost:58652/home/testview',                     controller: "ctrlcontroller",                  }             );          } 

and markup is:

<div ng-click="on()" class="gridstyle" ng-grid="gridoptions"> </div> <button ng-click="on()" type=button class="btn">Добавить</button> 

my testview:

<script type="text/ng-template" id="testview">     <div class="modal-header">         <h3 class="modal-title">i'm modal!</h3>     </div>     <div class="modal-body">         <ul>             <li ng-repeat="item in items">                 <a ng-click="selected.item = item">{{ item }}</a>             </li>         </ul>         selected: <b>{{ selected.item }}</b>     </div>     <div class="modal-footer">         <button class="btn btn-primary" ng-click="ok()">ok</button>         <button class="btn btn-warning" ng-click="cancel()">cancel</button>     </div> </script> 

another question: why take html-content
put in

<script type="text/ng-template" id="testview"> 

if use <script type="text/ng-template" id="testview"></script> id should testview.html (good practice)

then if use text/ng-template templateurl should equal id.

in case templateurl: 'testview'


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -