AngularJS+RequireJs实现动态加载JS和页面的方案研究【中】
3、动态加载的内容:
home.js
[html] view plain copy 在CODE上查看代码片派生到我的代码片
define(['app'], function(app)
{
app.controller('HomeViewController',
['$scope',function($scope) {
document.getElementById("test").onclick = function(){
swal($scope.title);
}
$scope.title = "Home Home Home Home";
}
]);
});
home-view.js
[html] view plain copy 在CODE上查看代码片派生到我的代码片
<div ng-controller="HomeViewController">
<button ui-sref="about">About</button>
<h1>{{ title }}</h1>
<br/>
<form name = "registerForm" id = "registerForm" method="post" class="form-horizontal" novalidate >
<p class="bg-warning" style = "margin-left:50px;margin-right:50px;"><i class="glyphicon glyphicon-info-sign"></i><span > <b>温馨提示:带<span style="color:red"> *</span>为必填项</b></span></p>
<div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="merchantName">商户名称<span style="color:red"> *</span></label>
<div class="col-md-2" show-errors>
<input type="text" class="form-control" id="merchantName" name = "merchantName" ng-model="merhantBaseInfo.merchantName" required>
<div class="help-block" ng-messages="registerForm.merchantName.$error" ng-if="registerForm.merchantName.$touched">
<span ng-message="required" >用户名不能为空</span>
</div>
</div>
<label class="control-label col-md-1" for="merchantShortName">商户简称</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="merchantShortName" name ="merchantShortName" ng-model="merhantBaseInfo.merchantShortName" >
</div>
<label class="control-label col-md-1" for="type">商户类型<span style="color:red"> *</span></label>
<div class="col-md-2" show-errors>
<select class="form-control" id="type" name = "type" ng-model="merhantBaseInfo.type" ng-options="type.name as type.desc for type in MerchantTypeArray" required >
<option value="">-- 请选择 --</option>
</select>
<div class="help-block" ng-messages="registerForm.type.$error" ng-if="registerForm.type.$touched">
<span ng-message="required" >商户类型不能为空</span>
</div>
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="comRegName">商户工商注册全名<span style="color:red"> *</span></label>
<div class="col-md-5" show-errors>
<input type="text" class="form-control" id="comRegName" name = "comRegName" ng-model="merhantBaseInfo.comRegName" required>
<div class="help-block" ng-messages="registerForm.comRegName.$error" ng-if="registerForm.comRegName.$touched">
<span ng-message="required" >商户注册全名不能为空</span>
</div>
</div>
<label class="control-label col-md-1" for="industry">所属行业<span style="color:red"> *</span></label>
<div class="col-md-2" show-errors>
<select class="form-control" id="industry" name = "industry" ng-model="merhantBaseInfo.industry" ng-options="industry.name as industry.desc for industry in IndustryArray" required>
<option value="">-- 请选择 --</option>
</select>
<div class="help-block" ng-messages="registerForm.industry.$error" ng-if="registerForm.industry.$touched">
<span ng-message="required" >所属行业不能为空</span>
</div>
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="coopMode">合作模式<span style="color:red"> *</span></label>
<div class="col-md-2" show-errors>
<select class="form-control" id="coopMode" name = "coopMode" ng-model="merhantBaseInfo.coopMode" ng-options="coopMode.name as coopMode.desc for coopMode in CoopModeArray" required>
<option value="">-- 请选择 --</option>
</select>
<div class="help-block" ng-messages="registerForm.coopMode.$error" ng-if="registerForm.coopMode.$touched">
<span ng-message="required" >合作模式不能为空</span>
</div>
</div>
<label class="control-label col-md-1" for="baseAcctBank">基本帐户开户银行名称</label>
<div class="col-md-2">
<input type="text" class="form-control" id="baseAcctBank" name = "baseAcctBank" ng-model="merhantBaseInfo.baseAcctBank" >
</div>
<label class="control-label col-md-1" for="baseAcct">银行基本帐户账号</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="baseAcct" name ="baseAcct" ng-model="merhantBaseInfo.baseAcct" >
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="org">组织机构代码</label>
<div class="col-md-2" show-errors>
<input type="text" class="form-control" id="org" name = "org" ng-model="merhantBaseInfo.org" >
</div>
<label class="control-label col-md-1" for="businessLicense">营业执照</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="businessLicense" name = "businessLicense" ng-model="merhantBaseInfo.businessLicense" >
</div>
<label class="control-label col-md-1" for="taxId">纳税人代码</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="taxId" name = "taxId" ng-model="merhantBaseInfo.taxId" >
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="officePhone">公司电话</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="officePhone" name ="officePhone" ng-model="merhantBaseInfo.officePhone" >
</div>
<label class="control-label col-md-1" for="address">地址</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="address" name = "address" ng-model="merhantBaseInfo.address" >
</div>
<label class="control-label col-md-1" for="websiteUrl">公司网址</label>
<div class="col-md-2" >
<input type="text" class="form-control" id="websiteUrl" name = "websiteUrl" ng-model="merhantBaseInfo.websiteUrl" >
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="scale">企业规模</label>
<div class="col-md-2">
<select type="text" class="form-control" id="scale" name = "scale" ng-model="merhantBaseInfo.scale" ng-options="scale.name as scale.desc for scale in ScaleArray" >
<option value="">-- 请选择 --</option>
</select>
</div>
<label class="control-label col-md-1" for="legalPerson">企业法人</label>
<div class="col-md-2">
<input type="text" class="form-control" id="legalPerson" name = "legalPerson" ng-model="merhantBaseInfo.legalPerson" >
</div>
<label class="control-label col-md-1" for="legalPersonId">法人证件号码</label>
<div class="col-md-2">
<input type="text" class="form-control" id="legalPersonId" name = "legalPersonId" ng-model="merhantBaseInfo.legalPersonId" >
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="province">合作区域<span style="color:red"> *</span></label>
<div class="col-md-2" show-errors>
<select type="text" id = "province" name = "province" class="form-control" ng-model="merhantBaseInfo.province" ng-change = "changeProvince()" ng-options="province.areaId as province.areaName for province in AllProvinceArray" required>
<option value="">---请选择---</option>
</select>
<div class="help-block" ng-messages="registerForm.province.$error" ng-if="registerForm.province.$touched">
<span ng-message="required" >合作区域不能为空</span>
</div>
</div>
<div class="col-md-2">
<select type="text" class="form-control" ng-model="merhantBaseInfo.city" ng-change="changeCity()" ng-options="city.areaId as city.areaName for city in nowCityArray">
<option value="">---请选择---</option>
</select>
</div>
<div class="col-md-2">
<select type="text" class="form-control" ng-model="merhantBaseInfo.district" ng-change="area=''" ng-options="district.areaId as district.areaName for district in nowDistrictArray">
<option value="">---请选择---</option>
</select>
</div>
</div>
<div class="form-group" style = "margin-left:50px;margin-right:-250px;">
<label class="control-label col-md-1" for="remark">备注</label>
<div class="col-md-8">
<textarea class="form-control" cols="4" id="remark" name="remark" ng-model="merhantBaseInfo.remark" rows="2" style = "resize: none;"></textarea>
</div>
</div>
</div>
<div>
</form>
</div>
AngularJS+RequireJs实现动态加载JS和页面的方案研究【中】的更多相关文章
- AngularJS+RequireJs实现动态加载JS和页面的方案研究【上】
1.入口页面 存放地址:src/main/webapp/WEB-INF/view/workflow/workflow.jsp [html] view plain copy 在CODE上查看代码片派生到 ...
- AngularJS+RequireJs实现动态加载JS和页面的方案研究【下】
about.js: [html] view plain copy 在CODE上查看代码片派生到我的代码片 define(['app'], function(app) { app.controller( ...
- [AngularJS] 使用AngularAMD动态加载Controller
[AngularJS] 使用AngularAMD动态加载Controller 前言 使用AngularJS来开发Single Page Application(SPA)的时候,可以选用AngularU ...
- [AngularJS] 使用AngularCSS动态加载CSS
[AngularJS] 使用AngularCSS动态加载CSS 前言 使用AngularAMD动态加载Controller 使用AngularAMD动态加载Service 上列两篇文章里,介绍了如何如 ...
- [AngularJS] 使用AngularAMD动态加载Service
[AngularJS] 使用AngularAMD动态加载Service 前言 「使用AngularAMD动态加载Controller」:这篇文章里介绍如何使用AngularAMD来动态加载Contro ...
- 使用jQuery动态加载js脚本
动态加载Javascript是一项非常强大且有用的技术.这方面的主题在本站已经讨论了不少,我也经常会在一些个人项目上使用RequireJS和Dojo加载js.它们很强大,但有时候也会得不偿失.如果你使 ...
- 使用jQuery动态加载js脚本文件的方法
动态加载Javascript是一项非常强大且有用的技术.这方面的主题在网上已经讨论了不少,我也经常会在一些个人项目上使用RequireJS和Dojo加载js 它们很强大,但有时候也会得不偿失.如果你使 ...
- JavaScript动态加载js文件
/********************************************************************* * JavaScript动态加载js文件 * 说明: * ...
- 动态加载js和css
开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法. 1.动态加载js 方法一:动态加载js文件 // 动态加载js脚本文件 function loadScript(url) { v ...
随机推荐
- Springmvc之表单验证
1.需要的相关jar 这里采用的是hibernate-validator-5.2.4.Final 和validation-api-1.1.0.Final 两个jar包.Hibernate Valida ...
- 数据挖掘 Apriori Algorithm python实现
该算法主要是处理关联分析的: 大多书上面都会介绍,这里就不赘述了: dataset=[[1,2,5],[2,4],[2,3],[1,2,4],[1,3],[2,3],[1,3],[1,2,3,5],[ ...
- spark 广播变量
Spark广播变量 使用广播变量来优化,广播变量的原理是: 在每一个Executor中保存一份全局变量,task在执行的时候需要使用和这一份变量就可以,极大的减少了Executor的内存开销. Exe ...
- Flutter框架概览
前言:进入新框架的开发前,有必要整体了解框架设计及特点,对该框架初步认识,此文对Flutter框架进行浅显梳理,以备查阅: Flutter框架 从该架构图可知,Flutter框架可分为Framew ...
- Mac下配置idea(Mac 10.12)
idea应该是第二个最好用的开发工具,除了宇宙最强大的VS第一外,过来就是它,其体系中已经发布很多语言的开发工具. idea:http://bbs.feng.com/read-htm-tid-1050 ...
- 【Eclipse】编译使用Makefile的C工程
创建MakeFile project新建src文件夹,将文件复制到里面.右击makefile,make targets->create->名称填上allmake targets->b ...
- ubuntu下安装h2数据库
1.下载h2数据库安装包 http://www.h2database.com/html/download.html 2.解压安装文件包到指定目录 3.运行sh文件 4.访问web地址: http:// ...
- 用maven来创建scala和java项目代码环境(图文详解)(Intellij IDEA(Ultimate版本)、Intellij IDEA(Community版本)和Scala IDEA for Eclipse皆适用)(博主推荐)
不多说,直接上干货! 为什么要写这篇博客? 首先,对于spark项目,强烈建议搭建,用Intellij IDEA(Ultimate版本),如果你还有另所爱好尝试Scala IDEA for Eclip ...
- ClouderManager集群在Linux里浏览器默认是英文,在Win里浏览器是中文,怎么更改?(图文详解)
不多说,直接上干货! 问题详情 在这里面如何英文改中文的吗? 莫非要把linux的语言环境给改了?? 我找找网页的语言字体怎么更改下 找到对应页面,修改成中文 解决办法 刷新下,即可 欢迎大家,加入我 ...
- class对象存储
当加载一个类完成后,会在内存中实例化一个java.lang.Class类的对象,也就是该类的类对象.但是并没有明确规定必须在java堆中存放该类对象,对于HotSpot虚拟机而言,类对象存放在方法区里 ...