angular.bootstrap
描述:
手动初始化angular。
这个函数会自动检测创建的module有没有被加载多次,如果有则会在浏览器的控制台打出警告日志,并且不会再次加载。这样可以避免在程序运行过程中许多奇怪的问题发生。
使用方法:
angular.bootstrap(element, [modules], [config]);
参数详解:
element | DOMElement |
DOM元素,作为angular的根元素 |
modules
(optional)
|
Array <String|Function|Array> |
modules的一个数组,这里的module可以是用户事先定义好的module或者是注入已有的function。 |
config
(optional)
|
Object |
拥有配置的对象。支持的配置如下: strictDi - 禁用angular函数的注解, 一般拥有debug. 默认值是false.
|
返回值:
返回最新创建的injector
示例代码:
示例一:
如果不使用此函数是如下来运行angular函数的
<!doctype html> <html ng-app="demo"> <body> <div ng-controller="WelcomeController"> {{greeting}} angular.bootstrap demo! </div> <script src="angular.min.js"></script> <script> var app = angular.module('demo', []) .controller('WelcomeController', function($scope) { $scope.greeting = 'Welcome'; }); </script> </body> </html>如果使用此函数
<!doctype html> <html> <body> <div ng-controller="WelcomeController"> {{greeting}} angular.bootstrap demo! </div> <script src="angular.min.js"></script> <script> var app = angular.module('demo', []) .controller('WelcomeController', function($scope) { $scope.greeting = 'Welcome'; }); angular.bootstrap(document, ['demo']); </script> </body> </html>
相关推荐
Embrace the full stack of web development, from styling with Bootstrap, building an interactive user interface with Angular 2, to storing data quickly and reliably in PostgreSQL. With this fully ...
Rails.Angular.Postgres.and.Bootstrap.Powerful.Effective.and.Efficient.Full-Stack.Web.Development.2016.1.pdf
Packt.Web.Development.with.Angular.and.Bootstrap.3rd.Edition 2019年10月最新版angualr 开发web应用 高清,可拷贝文字。
Wrox.Front-end.Development.with.ASP.NET.Core.Angular.and.Bootstrap
Updated for the latest releases of Angular and Bootstrap, this book shows you how to build web applications with cutting-edge web technologies Combine the best of both worlds to build single page apps...
本文实例分析了AngularJS使用angular.bootstrap完成模块手动加载的方法。分享给大家供大家参考,具体如下: 之前我们看到使用ng-app指令,可以实现模块的自动加载。现在我们看下,angular中如何手动加载模块。需要...
要启动一个angular应用,可以使用ng-app指令,也可以调用bootstrap方法手动启动。先看一下angular的bootstrap方法。 angular.bootstrap(element, [modules], [config]); element(必需)。要启动angular的根节点,...
angular-dashboard-framework, 带有 angular.js 和 Twitter Bootstrap的仪表板框架 angular-dashboard-framework 带有 angular.js 和 Twitter Bootstrap的仪表板框架。在这里,angular-dashboard-framework ( adf )
Jquery结合angular.js与bootstrap.js实现的无刷新翻页+查找特效源码.zip
angular-bootstrap-confirm, 显示 Bootstrap 确认 popover ( 没有jQuery或者 Bootstrap JS ) ! Angular Bootstrap 确认 table-内容关于安装工具文档文档演示工具开发工具许可协议单击元素时显示 Bootstrap 样式确认...
angular-ui-bootstrap源码与demo完整版
基于 Angular 的 Bootstrap 4 组件:NG Bootstrap
Front-end development with ASP.NET Core,Angular and Bootstrap web前端开发 使用ASP.NET Core,Angular 和Bootstrap 全书源码
Suave UI 是一个基于 AngularJS 开发的 Web UI 框架,包含 CSS 定义、NG 指令和服务用于快速高效的... angular.bootstrap(document, ['your-app', 'suave-ui']); }); [removed] 标签:Suave CSS框架
采用强大的Angular和Bootstrap框架搭建的web框架,不需要过多的配置就能搭建一个美观高拓展性的平台
angular.bootstrap(document.getElementById("test11"), ["myApp"]); }); 2、控制器末尾加入: .config(function ($sceProvider) { $sceProvider.enabled(false); }); 备注:还有一种方式单模块的参见我的文件中...
angular+bootstrap后台模板, 可直接运行看效果。 支持二种皮肤。
本demo使用bootstrap为前端页面框架,angular.js 为页面逻辑框架,制作了带数据加载,分页,并且支持快速搜索数据的表格分页插件,可以自定义显示多少条数据,动态管理各项设置。