我尝试使用meanjs制作旋转木马,Carousel元素存储在mongo中,是一个CRUD应用程序,其中一个视图是旋转木马angularjs。 问题是旋转木马只能工作一次,然后保留在最后一张幻灯片上。
我尝试使用jquery自动重新加载视图但不能正常工作。
我在这里给你代码:
layout.server.view.html:
<body class="ng-cloak">
<div ng-include="'modules/carruselps/views/carruselp.client.view.html'"></div>
Client.route:
'use strict';
//Setting up route
angular.module('carruselps').config(['$stateProvider',
function($stateProvider) {
// Carruselps state routing
$stateProvider.
state('carruselp', {
url: '/carrsp',
templateUrl: 'modules/carruselps/views/carruselp.client.view.html'
}).
state('listCarruselps', {
url: '/carruselps',
templateUrl: 'modules/carruselps/views/list-carruselps.client.view.html'
}).
state('createCarruselp', {
url: '/carruselps/create',
templateUrl: 'modules/carruselps/views/create-carruselp.client.view.html'
}).
state('viewCarruselp', {
url: '/carruselps/:carruselpId',
templateUrl: 'modules/carruselps/views/view-carruselp.client.view.html'
}).
state('editCarruselp', {
url: '/carruselps/:carruselpId/edit',
templateUrl: 'modules/carruselps/views/edit-carruselp.client.view.html'
});
}
]);
Client.controller
'use strict';
// Carruselps controller
angular.module('carruselps').controller('CrrslpsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Carruselps',
function($scope, $stateParams, $location, Authentication, Carruselps) {
$scope.authentication = Authentication;
// Find a list of Carruselps
this.slides = Carruselps.query();
}
]);
Cliente.service
'use strict';
//Carruselps service used to communicate Carruselps REST endpoints
angular.module('carruselps').factory('Carruselps', ['$resource',
function($resource) {
return $resource('carruselps/:carruselpId', { carruselpId: '@_id'
}, {
update: {
method: 'PUT'
}
});
}
]);
Client.view
<section data-ng-controller="CrrslpsController as slidesCtrl">
<carousel interval="5000">
<slide ng-repeat="slide in slidesCtrl.slides" active="slide.active">
<img ng-src="{{slide.imagen}}" style="margin:auto;">
<div class="carousel-caption">
<h4>{{slide.titulo}}</h4>
<p>{{slide.subtitulo}}</p>
<a class="btn btn-default" href="{{slide.boton}}">Ver más</a>
</div>
</slide>
</carousel>
</section>
提前致谢
CDM:
Microsoft Windows [Versión 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
C:\Users\Epsilon>cd..
C:\Users>cd..
C:\>cd meanselosvendo
C:\meanselosvendo>grunt
Running "jshint:all" (jshint) task
>> 66 files lint free.
Running "csslint:all" (csslint) task
Linting public/modules/apariencia/css/estilos.css...ERROR
[L1:C1]
WARNING: Outlines should only be modified using :focus. Use of outline: none or
outline: 0 should be limited to :focus rules. (outline-none) Browsers: All
[L32:C1]
>> ERROR: Expected RBRACE at line 32, col 1. This rule looks for recoverable syn
tax errors. (errors) Browsers: All
[L43:C6]
WARNING: Values of 0 shouldn't have units specified. You don't need to specify u
nits when a value is 0. (zero-units) Browsers: All
[L44:C5]
WARNING: Values of 0 shouldn't have units specified. You don't need to specify u
nits when a value is 0. (zero-units) Browsers: All
[L48:C1]
WARNING: Don't use IDs in selectors. Selectors should not contain IDs. (ids) Bro
wsers: All
[L54:C1]
WARNING: Don't use IDs in selectors. Selectors should not contain IDs. (ids) Bro
wsers: All
[L62:C1]
WARNING: Don't use IDs in selectors. Selectors should not contain IDs. (ids) Bro
wsers: All
[L74:C1]
WARNING: Don't use IDs in selectors. Selectors should not contain IDs. (ids) Bro
wsers: All
Warning: Task "csslint:all" failed. Used --force, continuing.
Running "concurrent:default" (concurrent) task
Running "watch" task
Waiting...
Running "nodemon:dev" (nodemon) task
[nodemon] v1.2.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: app/views/**/*.* gruntfile.js server.js config/**/*.js app/*
*/*.js
[nodemon] starting `node --debug server.js`
Debugger listening on port 5858
NODE_ENV is not defined! Using default development environment
MEAN.JS application started on port 3000
GET / 304 713.596 ms - -
GET /lib/bootstrap/dist/css/bootstrap.css 304 109.931 ms - -
GET /modules/apariencia/css/estilos.css 304 101.665 ms - -
GET /lib/bootstrap/dist/css/bootstrap-theme.css 304 124.894 ms - -
GET /modules/users/css/users.css 304 182.921 ms - -
GET /modules/core/css/core.css 304 198.863 ms - -
GET /lib/angular-cookies/angular-cookies.js 304 98.869 ms - -
GET /lib/angular/angular.js 304 261.896 ms - -
GET /lib/angular-animate/angular-animate.js 304 99.730 ms - -
GET /lib/angular-resource/angular-resource.js 304 122.659 ms - -
GET /lib/angular-touch/angular-touch.js 304 62.819 ms - -
GET /lib/angular-sanitize/angular-sanitize.js 304 61.129 ms - -
GET /lib/angular-ui-router/release/angular-ui-router.js 304 54.511 ms - -
GET /lib/angular-bootstrap/ui-bootstrap-tpls.js 304 54.148 ms - -
GET /lib/angular-ui-utils/ui-utils.js 304 68.218 ms - -
GET /config.js 304 68.956 ms - -
GET /application.js 304 70.202 ms - -
GET /modules/apariencia/apariencia.client.module.js 304 62.755 ms - -
GET /modules/apariencia/config/apariencia.client.routes.js 304 67.864 ms - -
GET /modules/apariencia/controllers/apariencia.client.controller.js 304 70.170 m
s - -
GET /modules/carruselps/carruselps.client.module.js 304 74.529 ms - -
GET /modules/core/core.client.module.js 304 74.571 ms - -
GET /modules/users/users.client.module.js 304 75.165 ms - -
GET /modules/apariencia/services/apariencia.client.service.js 304 76.396 ms - -
GET /modules/carruselps/controllers/carruselps.client.controller.js 304 82.147 m
s - -
GET /modules/carruselps/controllers/crr.client.controller.js 304 85.169 ms - -
GET /modules/carruselps/services/carruselps.client.service.js 304 86.989 ms - -
GET /modules/carruselps/config/carruselps.client.routes.js 304 93.307 ms - -
GET /modules/core/controllers/header.client.controller.js 304 90.408 ms - -
GET /modules/core/config/core.client.routes.js 304 101.210 ms - -
GET /modules/core/controllers/home.client.controller.js 304 64.122 ms - -
GET /modules/core/services/menus.client.service.js 304 64.984 ms - -
GET /modules/users/config/users.client.config.js 304 64.989 ms - -
GET /modules/users/config/users.client.routes.js 304 64.446 ms - -
GET /modules/users/controllers/authentication.client.controller.js 304 76.634 ms
- -
GET /modules/users/controllers/password.client.controller.js 304 73.933 ms - -
GET /modules/users/services/users.client.service.js 304 41.202 ms - -
GET /modules/users/controllers/settings.client.controller.js 304 50.162 ms - -
GET /modules/users/services/authentication.client.service.js 304 46.625 ms - -
GET /lib/angular-bootstrap/ui-bootstrap-tpls.js 304 45.995 ms - -
GET /modules/carruselps/views/carruselp.client.view.html 304 12.826 ms - -
GET /carruselps 304 116.666 ms - -
GET /lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 304 17.547 ms -
-
GET /lib/bootstrap/dist/css/bootstrap-theme.css 304 133.250 ms - -
GET /lib/bootstrap/dist/css/bootstrap.css 304 145.264 ms - -
GET /modules/apariencia/css/estilos.css 304 143.821 ms - -
GET /modules/core/css/core.css 304 145.359 ms - -
GET /modules/users/css/users.css 304 145.968 ms - -
GET /lib/bootstrap/dist/css/bootstrap.css.map 304 34.354 ms - -
GET /lib/bootstrap/dist/css/bootstrap-theme.css.map 304 17.580 ms - -