角度2初始加载

时间:2018-03-13 03:45:42

标签: angular visual-studio-2015

我在visual studio 2015(快速入门)开发了我的angular 2应用程序,用于按F5运行我的应用程序。我的应用程序工作得非常好,但加载应用程序需要10秒,因为我的应用程序中的所有html文件都是在浏览器中下载的。

如何实现gulp和webpack(visual studio 2015)或基于我的文件夹结构system.config.js和package.json的任何其他方法。

文件夹结构:

enter image description here



<!DOCTYPE html>
<html>
  <head>
      <base href="/src/">
      <!--<base href="/">-->
      <title>BostonPizza-Dashboard</title>   
    <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
      <!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->
    <!--<link rel="stylesheet" href="styles.css">-->
      
      <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
      <!-- BEGIN GLOBAL MANDATORY STYLES -->
      <link href="assets/plugins/css/bootstrap.min.css" rel="stylesheet">
      <link href="assets/plugins/css/bootstrap-select.css" rel="stylesheet">
      <link href="assets/plugins/css/sumoselect.css" rel="stylesheet">
      <link href="assets/plugins/css/font-awesome.css" rel="stylesheet">
      <link href="assets/plugins/css/itcavant.css" rel="stylesheet">
      <link href="assets/plugins/css/font-awesome.css" rel="stylesheet">
      <link href="assets/plugins/css/simple-line-icons.css" rel="stylesheet">
      <link href="assets/plugins/css/daterangepicker.css" rel="stylesheet">
    
      <!-- END GLOBAL MANDATORY STYLES -->
     
      <!-- BEGIN THEME LAYOUT STYLES  -->
      <link href="assets/css/style.css" rel="stylesheet">
      <link href="assets/css/bptheme.css" rel="stylesheet">
      <link href="assets/css/mediaquery.css" rel="stylesheet">
      <!-- END THEME LAYOUT STYLES  -->
      <!-- BEGIN OLD IE BROWSER -->
      <!--[ifltIE9]>
    <scriptsrc="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <scriptsrc="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
      <!-- END OLD IE BROWSER -->

      
      
     

    <!-- Polyfill(s) for older browsers -->
    <script src="/node_modules/core-js/client/shim.min.js"></script>

    <script src="/node_modules/zone.js/dist/zone.js"></script>
    <script src="/node_modules/systemjs/dist/system.src.js"></script>
      
     

      <!-- BEGIN CORE PLUGINS -->
      <script src="assets/plugins/js/jquery.js" type="text/javascript"></script>
      
      <script src="assets/plugins/js/bootstrap.min.js" type="text/javascript"></script>
      <script src="assets/plugins/js/bootstrap-select.min.js" type="text/javascript"></script>
      <script src="assets/plugins/js/jquery.sumoselect.js" type="text/javascript"></script>
      <script src="assets/plugins/js/moment.js" type="text/javascript"></script>     
      <script src="assets/plugins/js/daterangepicker.js" type="text/javascript"></script>
     
      <script>
          $(document).ready(function () {

              
              

              $(window).scroll(function () {
                  set = $(document).scrollTop() + "px";
                  $('#floatdiv').animate({
                      top: set
                  }, {
                      duration: 500,
                      queue: false
                  });
              });



          });
          
          function openNav() {
          
                  document.getElementById("mySidenav").style.width = "200px";
                  document.getElementById("overlayblock").style.width = "100%";
                  document.getElementById("overlayblock").style.opacity = "0.8";
                 
                  
                  
              }

             
             
          function closeNav() {
              
                  document.getElementById("mySidenav").style.width = "0";
                  document.getElementById("overlayblock").style.width = "0%";
                  document.getElementById("overlayblock").style.opacity = "0";
                  
                  
              }
             
              /*******************************
               * ACCORDION WITH TOGGLE ICONS
               *******************************/
              function toggleIcon(e) {
                  $(e.target)
                      .prev('.panel-heading')
                      .find(".more-less")
                      .toggleClass('icon-arrow-up icon-arrow-down');
              }
              $('.panel-group').on('hidden.bs.collapse', toggleIcon);
              $('.panel-group').on('shown.bs.collapse', toggleIcon);


      </script>
      <!-- END CORE PLUGINS -->

    <script src="systemjs.config.js"></script>
    <script>
        System.import('main.js').catch(function (err) { console.error(err); });        
    </script>
  </head>

  <body>
    <my-app><!--Loading AppComponent content here ...-->
        
    <div class="loadingbg"><img src="assets/images/BP_logo.png" class="img-responsive main_bg" /></div>  
    </my-app>
      
  </body>
</html>
&#13;
&#13;
&#13;

&#13;
&#13;
@DataProvider
    public Object[][] getgbTestData(){
        Object data[][] = testutil.getTestData(sheetName);
        return data;
    }

    @Test(dataProvider="getgbTestData")
    public void addnewuser(String fname,String lname,String email,String pass,String conpass) throws IOException{

        newuser.newregistration1(fname, lname, email, pass, conpass);

        }

**method:**
public Personaldetails newregistration1(String fsname,String lsname,String email1,String pass1,String conpass1) throws IOException {

        Account.click();
        Registerlink.click();
        Firstname.sendKeys(fsname);
        Lastname.sendKeys(lsname);
        useremail.sendKeys(email1);
        password.sendKeys(pass1);
        confirmpassword.sendKeys(conpass1);
        submit.click();
        //return person;
        return new Personaldetails();

    }
&#13;
public static Object[][] getTestData(String sheetName) {
    FileInputStream file = null;
    try {
        file = new FileInputStream(TESTDATA_SHEET_PATH);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    try {
        book = WorkbookFactory.create(file);
    } catch (InvalidFormatException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    sheet = book.getSheet(sheetName);
    Object[][] data = new Object[sheet.getLastRowNum()][sheet.getRow(0).getLastCellNum()];
    // System.out.println(sheet.getLastRowNum() + "--------" +
    // sheet.getRow(0).getLastCellNum());
    for (int i = 0; i < sheet.getLastRowNum(); i++) {
        for (int k = 0; k < sheet.getRow(0).getLastCellNum(); k++) {
            data[i][k] = sheet.getRow(i + 1).getCell(k).toString();
            // System.out.println(data[i][k]);
        }
    }
    return data;
}
&#13;
&#13;
&#13;

0 个答案:

没有答案