mysql怎么备份数据库操作备份

angularjs 初体验 循环 - 快乐每一天 - ITeye技术网站
博客分类:
&html ng-app&
&div id="myCarousel" class="carousel slide" ng-controller="CarouselCtrl"&
&ol class="carousel-indicators"&
&li class="pointer{{ pic.class }}" data-target="#myCarousel" data-slide-to="{{ $index }}" ng-repeat="pic in pictures"&&/li&
&!-- Carousel items --&
&div class="carousel-inner"&
&div class="item{{ pic.class }}" ng-repeat="pic in pictures"&
&img src="{{ pic.img }}" alt /&
&div class="carousel-caption"&
&h4&{{ pic.title }}&/h4&
&p&{{ pic.content }}&/p&
&!-- Carousel nav --&
&a class="carousel-control left" href="#myCarousel" data-slide="prev"&&&/a&
&a class="carousel-control right" href="#myCarousel" data-slide="next"&&&/a&
&script type="text/javascript" src="../../js/bootstrap.min.js"&&/script&
&script type="text/javascript" src="../../js/angular.min.js"&&/script&
function CarouselCtrl($scope) {
$scope.pictures = [];
$scope.pictures.push({class: ' active', img: '/mw690/51baa38egw1ehxxxx513j20xh0p0tqm.jpg',
title: '徐家汇公园长廊漫步', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egw1eh0xxxxoj20xh0p0qn4.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egw1eh0rfxxxxdwj20xh0p0tog.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egw1ehxxxxmsj20xh0p0h9x.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egw1ehxxxxzcvj20xh0p0avz.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egw1eh0xxxxwpwj20xh0p0gri.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
$scope.pictures.push({class: '', img: '/mw690/51baa38egxxxxditzozj21kw16hhdt.jpg',
title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
其他实例:
&div ng-init="names=['Jani','Hege','Kai']"&
&p&使用 ng-repeat 来循环数组&/p&
&li ng-repeat="x in names"&
&tr&&th&row number&/th&&/tr&
&tr ng-repeat="i in [1, 2, 3, 4, 5, 6, 7]"&&td&{{i}}&/td&&/tr&
浏览: 2316640 次
来自: 上海
真是太坑爹了
dragonhunter 写道你就是个2bInteger.pa ...
不错呀。。。。。。。。。。。。。。
15.**不好使
我换成0.14.5可以用了2015年7月 Web 开发大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。--一步,二步,三步,N步,二行脚印
张映 发表于
分类目录:
标签:, , , , ,
angularjs自身有二种,设置全局变量的方法,在加上js的设置全局变量的方法,总共有三种。要实现的功能是,在ng-app中定义的全局变量,在不同的ng-controller里都可以使用。
1,通过var 直接定义global variable,这根纯js是一样的。
2,用angularjs value来设置全局变量 。
3,用angularjs constant来设置全局变量 。
下面用一个例子,来说明,上面3种方法:
1,在app模块中,定义全局变量
'use strict';
/* App Module */
var test2 = 'tank';
//方法1,定义全局变量
var phonecatApp = angular.module('phonecatApp', [
//定义一个ng-app
'ngRoute',
'phonecatControllers',
'tanktest'
phonecatApp.value('test',{"test":"test222","test1":"test111"});
//方法2定义全局变量
phonecatApp.constant('constanttest', 'this is constanttest');
//方法3定义全局变量
phonecatApp.config(['$routeProvider',
//设置路由
function($routeProvider) {
$routeProvider.
when('/phones', {
templateUrl: 'partials/phone-list.html'
//这里没有设置controller,可以在模块中加上ng-controller
when('/phones/:phoneId', {
templateUrl: 'partials/phone-detail.html',
controller: 'PhoneDetailCtrl'
when('/login', {
templateUrl: 'partials/login.html',
controller: 'loginctrl'
otherwise({
redirectTo: '/login'
2,在controller中调用全局变量
'use strict';
/* Controllers */
var phonecatControllers = angular.module('phonecatControllers', []);
phonecatControllers.controller('PhoneListCtrl', ['$scope','test','constanttest',
function($scope,test,constanttest) {
$scope.test =
//方法2,将全局变量赋值给$scope.test
$scope.constanttest =
//方法3,赋值
$scope.test2 = test2;
//方法1,赋值
3,在html中看一下效果
&div data-ng-controller="PhoneListCtrl"&
{{test.test1}}
{{constanttest}}
结果:test111 this is constanttest tank
其实我们可以通过其他方法来实现全局变量,例如:angularjs factory的功能。
转载请注明作者:海底苍鹰地址:

我要回帖

更多关于 mysql备份与恢复 的文章

 

随机推荐