zoukankan      html  css  js  c++  java
  • AngularJS实现单页面应用

    一、创建项目目录

    二、angularJS模块组织

      2.1 在index.html页面引入angular主文件包和angular路由模块的包

      2.2 创建app.js模块

        在index.html页面引入app.js模块

    var YK = angular.module('Yk',['ngRoute','Controllers');

      2.3 创建controllers.js模块

        在index.html页面引入controllers.js模块

    //实例一个模块,用来专门管理所有的控制器
    angular.module('Controllers',[])
    .controller('DemoController',['$scope',function($scope){
        //在视图模块必须调用控制器才能启用,在视图模块需加上ng-controller='DemoController'
       console.log('启动了')
    }]

      2.4 创建directives.js模块

        在index.html页面引入directives.js模块

      2.5 创建services.js模块

        在index.html页面引入services.js模块

  • 相关阅读:
    第一个java程序
    Java安装
    Maven安装
    Effective Java 3
    gateway + jwt 网关认证
    idea的使用
    线程池的使用
    服务注册发现Eureka
    zookeeperAPI的常用方法
    sss
  • 原文地址:https://www.cnblogs.com/ytwanzi/p/6434739.html
Copyright © 2011-2022 走看看