gpt4 book ai didi

javascript - 我试图在 laravel 项目中放置一个 Angular slider

转载 作者:行者123 更新时间:2023-11-28 00:58:27 25 4
gpt4 key购买 nike

我试图将 Angularjs 图像 slider 放入 laravel 项目中,这是 View 的代码

<!DOCTYPE html>
<html lang="{{ config('app.locale') }}" ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular-animate.js"></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.2.1.js"></script>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">

var app = angular.module('app', ['ui.bootstrap']);
app.controller('CarouselDemoCtrl', CarouselDemoCtrl);

    function CarouselDemoCtrl($scope){
$scope.myInterval = 3000;
$scope.noWrapSlides = false;
$scope.activeSlide = 0;
$scope.slides = [
{
image: 'images/hotel1.jpg'
},
{
image: 'images/piscina1.jpg'
},
{
image: 'images/pool1.jpg'
},
{
image: 'images/presidencial1.jpg'
}
];
}
</script>
<title>Papayon Resorts</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
</head>
<body>
<div class="flex-center position-ref full-height">
@if (Route::has('login'))
<div class="top-right links">
@if (Auth::check())
<a href="{{ url('/home') }}">Inicio</a>
@else
<a href="{{ url('/login') }}">Iniciar Sesión</a>
<a href="{{ url('/register') }}">Registro</a>
@endif
</div>
@endif
<div class="content">
<div class="title m-b-md">
Papayon Resorts
</div>
<div class="links">
<a href="/habitaciones/">Habitaciones</a>
<a href="/promosiones">Paquetes de promoción</a>
</div>
</div>
<div>
<div ng-controller="CarouselDemoCtrl" id="slides_control">
<div>
<uib-carousel interval="myInterval" active="activeSlide">
<uib-slide ng-repeat="slide in slides" index="$index">
<img ng-src="{{slide.image}}" style="margin:auto; height: 500px; width: 700px" ><!-- this is the line where I have the error-->
<div class="carousel-caption">
</div>
</uib-slide>
</uib-carousel>
</div>
</div>
</div>
</body>

但是当我这样做时它告诉我这个错误

下面是我得到的错误:

enter image description here

知道如何解决这个问题吗?

最佳答案

使用 @ 符号通知 Blade 渲染引擎一个表达式应该保持不变

改变这个

<img ng-src="{{slide.image}}" style="margin:auto; height: 500px; width: 700px" ><!-- this is the line where I have the error-->

<img ng-src="@{{slide.image}}" style="margin:auto; height: 500px; width: 700px" ><!-- this is the line where I have the error-->

文档:https://laravel.com/docs/5.4/blade#blade-and-javascript-frameworks

关于javascript - 我试图在 laravel 项目中放置一个 Angular slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43463750/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com