简体   繁体   中英

angularjs ng-admin 0.9 shows nothing

i am trying to use ng-admin for the firs time. i am just following the example in and i am unable to see anything in the browser. my code is minimal, so not sure what i am doing wrong.

any ideas? did i not install correctly? i just downloaded it from a site and unzipped the file.

<!DOCTYPE html>
<html>
   <head>
       <meta charset="utf-8">
       <title>My First Admin</title>
       <link rel="stylesheet" href="external/ng-admin/build/ng-admin.min.css">
       <script src="external/ng-admin/build/ng-admin.min.js" type="text/javascript"></script>
       <script src="admin.js" type="text/javascript"></script>
   </head>

   <body ng-app="myApp"  ng-strict-di>
       <div ui-view="ng-admin"></div>
   </body>
</html>


// declare a new module called 'myApp', and make it require the `ng-admin`     module as a dependency
var myApp = angular.module('myApp', ['ng-admin']);

// declare a function to run when the module bootstraps (during the 'config' phase)
myApp.config(['NgAdminConfigurationProvider', function (nga) {

// create an admin application
var admin = nga.application('My First Admin')
    .baseApiUrl("http://vl-esifakis-ice:8000/tracker/");

var foundry = nga.entity('foundry');

foundry.listView().fields([                       
                           nga.field('name'),
                           nga.field('id')
                          ]);

admin.addEntity(foundry);
   // more configuration here later
   // ...
   // attach the admin application to the DOM and execute it
   nga.configure(admin);
}]);

Here is a demo which i have made,

<!DOCTYPE html>
<html>
  <head>
    <link data-require="ng-admin@0.0.1" data-semver="0.0.1" rel="stylesheet" href="https://unpkg.com/ng-admin/build/ng-admin.min.css" />
    <link rel="stylesheet" href="style.css" />
    <script data-require="ng-admin@0.0.1" data-semver="0.0.1" src="https://unpkg.com/ng-admin/build/ng-admin.min.js"></script>
    <script data-require="angular-mocks@*" data-semver="1.3.5" src="https://code.angularjs.org/1.3.7/angular-mocks.js"></script>
    <script src="admin.js"></script>
    <!-- <script src="backend.js"></script>
    -->    
  </head>
  <body ng-app="myApp">
    <div ui-view="ng-admin"></div>
  </body>
</html>

DEMO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM