angular单页应用

Laravel and Angular have both become very well renowned tools in the web development world lately. Laravel for the great things it brings to the PHP community and Angular for the amazing frontend tools and its simplicity. Combining these two great frameworks only seems like the logical next step.

Laravel和Angular最近都已成为Web开发界非常知名的工具。 Laravel带来了PHP社区带来的伟大成就,而Angular带来了惊人的前端工具及其简单性。 将这两个伟大的框架结合起来似乎是合乎逻辑的下一步。

For our use cases, we will be using Laravel as the RESTful API backend and Angular as the frontend to create a very simple single page comment application.

对于我们的用例,我们将使用Laravel作为RESTful API后端,并使用Angular作为前端来创建一个非常简单的单页注释应用程序。

This will be a simple example to show off how to get started using these two technologies so don't hope for any extra database stuff on how to handle sub-comments or anything like that.

这将是一个简单的示例,以展示如何开始使用这两种技术,因此不要希望任何其他有关如何处理子注释或类似内容的数据库资料。

我们将要建设的 (What We'll Be Building)

This will be a simple single page comment application:

这将是一个简单的单页注释应用程序:

  • RESTful Laravel API to handle getting, creating, and deleting comments

    RESTful Laravel API,用于处理获取,创建和删除注释
  • Angular frontend to handle showing our creation form and the comments

    Angular前端,用于显示我们的创建表单和注释
  • Ability to create a comment and see it added to our list w/o page refresh

    能够创建评论并将其添加到我们的列表中,而无需刷新页面
  • Ability to delete a comment and see it removed from our list w/o page refresh

    能够删除评论,并在不刷新页面的情况下将其从我们的列表中删除

Overall, these are very simple concepts. Our focus will be to see the intricacies of how Laravel and Angular can work together.

总体而言,这些是非常简单的概念。 我们的重点将是了解Laravel和Angular如何协同工作的复杂性

laravel-angular-single-page-application

Laravel后端 (The Laravel Backend)

设置Laravel (Setting Up Laravel)

Go ahead and get your Laravel setup ready. We'll be doing some basic things to get our backend to do CRUD on comments:

继续,准备好您的Laravel设置。 我们将做一些基本的事情来使后端对评论进行CRUD:

  • Create a database migration

    创建数据库迁移
  • Seed our database with sample comments

    给我们的数据库添加样本注释
  • Create our routes for our API

    为我们的API创建路线
  • Creating a catch-all route to let Angular handle routing

    创建一个包罗万象的路由以让Angular处理路由
  • Creating a resource controller for comments

    创建用于评论的资源控制器

使我们的数据库准备好迁移 (Getting our Database Ready Migrations)

We will need a simple structure for our comments. We just need text and author. Let's create our Laravel migration to create our comments.

我们将需要一个简单的结构来发表评论。 我们只需要文本作者 。 让我们创建Laravel迁移以创建我们的注释。

Let's run the artisan command that will create our comments migration so that we can create the table in our database:

让我们运行artisan命令来创建注释迁移,以便我们可以在数据库中创建表:

php artisan migrate:make create_comments_table --create=comments

php artisan migrate:make create_comments_table --create=comments

We'll use the Laravel Schema Builder to create the text and author fields that we need. Laravel will also create the id column and the timestamps so that we know how long ago the comment was made. Here is the code for the comments table:

我们将使用Laravel Schema Builder创建所需的textauthor字段。 Laravel还将创建id列和时间戳,以便我们知道多久之前进行评论。 这是注释表的代码:

// app/database/migrations/####_##_##_######_create_comments_table.php
.../*** Run the migrations.** @return void*/public function up(){Schema::create('comments', function(Blueprint $table){$table->increments('id');$table->string('text');$table->string('author');$table->timestamps();});}...

Make sure you go adjust your database settings in app/config/database.php with the right credentials. Now we will run the migration so that we create this table with the columns that we need:

确保使用正确的凭据在app/config/database.php调整数据库设置 。 现在,我们将运行迁移,以便我们使用所需的列创建该表:

php artisan migrate

php artisan migrate

laravel-angular-migrate

With our table made, let's create an Eloquent model so that we can interact with it.

制作完表格后,让我们创建一个Eloquent模型,以便我们可以与其进行交互。

评论模型 (Comment Model)

We will be using Laravel Eloquent models to interact with our database. This will be very easy to do. Let's create a model: app/models/Comment.php.

我们将使用Laravel Eloquent模型与我们的数据库进行交互。 这将非常容易做到。 让我们创建一个模型: app/models/Comment.php

<?php// app/models/Comment.phpclass Comment extends Eloquent { // let eloquent know that these attributes will be available for mass assignment protected $fillable = array('author', 'text'); }

We now have our new table and model. Let's fill it with some sample data using Laravel Seeding.

现在,我们有了新的表格和模型。 让我们使用Laravel Seeding填充一些示例数据。

播种我们的数据库 (Seeding Our Database)

We will need a few comments so that we can test a few things. Let's create a seed file and fill our database with 3 sample comments.

我们将需要一些评论,以便我们可以测试一些东西。 让我们创建一个种子文件,并用3个示例注释填充我们的数据库。

Create a file: app/database/seeds/CommentTableSeeder.php and fill it with this code.

创建一个文件: app/database/seeds/CommentTableSeeder.php ,并使用以下代码填充它。

<?php // app/database/seeds/CommentTableSeeder.phpclass CommentTableSeeder extends Seeder {public function run(){DB::table('comments')->delete();Comment::create(array('author' => 'Chris Sevilleja','text' => 'Look I am a test comment.'));Comment::create(array('author' => 'Nick Cerminara','text' => 'This is going to be super crazy.'));Comment::create(array('author' => 'Holly Lloyd','text' => 'I am a master of Laravel and Angular.'));}    }

To call this Seeder file, let's open app/database/seeds/DatabaseSeeder.php and add the following:

要调用此Seeder文件,请打开app/database/seeds/DatabaseSeeder.php并添加以下内容:

// app/database/seeds/DatabaseSeeder.php.../*** Run the database seeds.** @return void*/public function run(){Eloquent::unguard();$this->call('CommentTableSeeder');$this->command->info('Comment table seeded.');}...

Now let's run our seeders using artisan.

现在,让我们使用工匠来运行播种机。

php artisan db:seed

php artisan db:seed

laravel-angular-database-seed

Now we have a database with a comment table, an Eloquent model, and samples in our database. Not bad for a day's work... but we're not even close to done yet.

现在,我们有了一个带有注释表的数据库一个Eloquent模型数据库中的示例 。 对于一天的工作来说还不错……但是我们还没有完成。

注释资源控制器app / controllers / CommentController.php (Comment Resource Controller app/controllers/CommentController.php)

We will use Laravel's resource controllers to handle our API functions for comments. Since we'll be using Angular to display a resource and show create and update forms, we'll create a resource controller with artisan without the create or edit functions.

我们将使用Laravel的资源控制器来处理我们的API函数以进行注释。 由于我们将使用Angular来显示资源并显示创建和更新表单,因此我们将使用手Craft.io者创建资源控制器,而无需创建编辑功能。

Let's create our controller using artisan.

让我们使用工匠创建我们的控制器。

php artisan controller:make CommentController --only=index,store,destroy

php artisan controller:make CommentController --only=index,store,destroy

For our demo app, we'll only be using these three functions in our resource controller. To expand on this you'd want to include all the functions like update, show, update for a more fully fledged app.

对于我们的演示应用程序,我们将仅在资源控制器中使用这三个功能。 要对此进行扩展,您需要包括所有功能,如updateshowupdate ,以提供更为完善的应用程序。

laravel-angular-create-controller

Now we've created our controller. We don't need the create and edit functions because Angular will be handling showing those forms, not Laravel. Laravel is just responsible for sending data back to our frontend. We also took out the update function for this demo just because we want to keep things simple. We'll handle creating, showing, and deleting comments.

现在,我们创建了控制器。 我们不需要createedit功能,因为Angular将处理显示这些形式的内容,而不是Laravel。 Laravel只是负责将数据发送回我们的前端。 我们只是为了保持简单而删除了此演示的update功能。 我们将处理创建,显示和删除评论。

To send data back, we will want to send all our data back as JSON. Let's go through our newly created controller and fill out our functions accordingly.

要发送回数据,我们将希望将所有数据作为JSON发送回。 让我们浏览一下我们新创建的控制器,并相应地填写我们的功能。

<?php // app/controllers/CommentController.phpclass CommentController extends BaseController {/*** Send back all comments as JSON** @return Response*/public function index(){return Response::json(Comment::get());}/*** Store a newly created resource in storage.** @return Response*/public function store(){Comment::create(array('author' => Input::get('author'),'text' => Input::get('text')));return Response::json(array('success' => true));}/*** Remove the specified resource from storage.** @param  int  $id* @return Response*/public function destroy($id){Comment::destroy($id);return Response::json(array('success' => true));}}

You can see how easy it is to handle CRUD with Laravel and Eloquent. It's incredibly simple to handle all the functions that we need.

您可以看到使用Laravel和Eloquent处理CRUD有多么容易。 处理我们需要的所有功能非常简单。

With our controller ready to go, the last thing we need to do for our backend is routing.

准备好控制器后,我们后端需要做的最后一件事就是路由。

Extra Reading: Simple Laravel CRUD with Resource Controllers

附加阅读 : 具有资源控制器的简单Laravel CRUD

我们的路线app / routes.php (Our Routes app/routes.php)

With our database ready to rock and roll, let's handle the routes of our Laravel application. We will need routes to send users to the Angular frontend since that will have its own routing. We will also need routes for our backend API so people can access our comment data.

在数据库准备就绪后,让我们处理Laravel应用程序的路由。 我们将需要路由来将用户发送到Angular前端,因为它将具有自己的路由。 我们还将需要后端API的路由,以便人们可以访问我们的评论数据。

Let's create the Angular pointing routes. We will need one for the home page and a catch-all route to send users to Angular. This ensures that any way a user accesses our site, they will be routed to the Angular frontend.

让我们创建角度指向路线。 我们将需要一个主页页面一条通向所有人的路线,以将用户发送到Angular 。 这样可以确保用户以任何方式访问我们的网站,都将被路由到Angular前端。

We'll be prefixing our API routes with... (drumroll please)... api. This way, if somebody wants to get all comments, they will use the URL: http://example.com/api/comments. This just makes sense moving forward and is some basic API creation good tactics.

我们将在API路由的前面加上...(请鼓动)... api 。 这样,如果有人想获得所有评论 ,他们将使用URL: http://example.com/api/comments : http://example.com/api/comments 。 向前迈进是有意义的,并且是一些基本的API创建良好策略。

<?php // app/routes.php
// HOME PAGE ===================================  
// we dont need to use Laravel Blade 
// we will return a PHP file that will hold all of our Angular content
// see the "Where to Place Angular Files" below to see ideas on how to structure your app return  
Route::get('/', function() {   View::make('index'); // will return app/views/index.php 
});// API ROUTES ==================================  
Route::group(array('prefix' => 'api'), function() {// since we will be using this just for CRUD, we won't need create and edit// Angular will handle both of those forms// this ensures that a user can't access api/create or api/edit when there's nothing thereRoute::resource('comments', 'CommentController', array('only' => array('index', 'store', 'destroy')));});// CATCH ALL ROUTE =============================  
// all routes that are not home or api will be redirected to the frontend 
// this allows angular to route them 
App::missing(function($exception) { return View::make('index'); 
});

We now have our routes to handle the 3 main things our Laravel backend needs to do.

现在,我们有路线来处理Laravel后端需要做的三件事。

Handling Catch-All Routes: In Laravel, you can do this a few ways. Usually it isn't ideal to do the above code and have a catch-all for your entire application. The alternative is that you can use 处理所有路线 :在Laravel中,您可以通过几种方法来实现。 通常,执行上面的代码并为整个应用程序提供全部功能并不是理想的选择。 另一种选择是您可以使用Laravel Controller Missing Methods to catch routes. Laravel Controller Missing Methods来捕获路由。

Testing All Our Routes Let's make sure we have all the routes we need. We'll use artisan and see all our routes:

测试我们的所有路线确保我们拥有所需的所有路线。 我们将使用工匠,并查看所有路线:

php artisan routes

php artisan routes

This command will let us see our routes and sort of a top-down view of our application.

该命令将让我们看到我们的路线以及我们应用程序的自顶向下视图。

laravel-angular-artisan-routes

We can see the HTTP verb and the route used to get all comments, get a single comment, create a comment, and destroy a comment. On top of those API routes, we can also see how a user get routed to our Angular application by the home page route.

我们可以看到HTTP动词和用于获取所有注释,获取单个注释,创建注释以及销毁注释的路由。 在这些API路由的顶部,我们还可以看到如何通过主页路由将用户路由到我们的Angular应用程序。

后端完成 (Backend Done)

Finally! Our Laravel API backend is done. We have done so much and yet, there's still so much to do. We have set up our database and seeded it, created our models and controllers, and created our routes. Let's move onto the frontend Angular work.

最后! 我们的Laravel API后端已完成。 我们已经做了很多事情,但是,还有很多事情要做。 我们已经建立了数据库并将其作为种子创建了模型和控制器 ,并创建了路线 。 让我们继续进行前端Angular工作。

哪里放置角度文件 ( Where to Place Angular Files )

I've seen this question asked a lot. Where exactly should I be putting Angular files and how does Laravel and Angular work together. We did an article on getting Laravel Blade and Angular to work together. This article works under the assumption that we aren't even going to use Blade.

我看到这个问题问了很多。 我应该将Angular文件放在哪里以及Laravel和Angular如何一起工作。 我们写了一篇文章,介绍如何使Laravel Blade和Angular一起工作 。 本文是在我们甚至不打算使用Blade的前提下工作的。

To let Angular handle the frontend, we will need Laravel to pass our user to our index.php file. We can place this in a few different places. By default, when you use:

为了让Angular处理前端,我们需要Laravel将用户传递到我们的index.php文件。 我们可以将其放置在几个不同的地方。 默认情况下,使用时:

// app/routes.phpRoute::get('/', function() {return View::make('index'); 
});

This will return app/views/index.php. Laravel will by default look in the app/views folder.

这将返回app/views/index.php 。 Laravel默认情况下会在app/views文件夹中查找。

Some people may want to keep Angular files completely separate from Laravel files. They will want their entire application to be housed inside of the public folder. To do this is simple: just change the default View location to the public folder. This can be done in the app/config/view.php file.

某些人可能希望将Angular文件与Laravel文件完全分开。 他们希望将整个应用程序放在public文件夹中。 要做到这一点很简单:只需将默认的“查看”位置更改为公用文件夹。 这可以在app/config/view.php文件中完成。

// app/config/view.php
...// make laravel look in public/views for view files'paths' => array(__DIR__.'/../../public/views'),...

Now return View::make('index') will look for public/views/index.php. It is all preference on how you'd like to structure your app. Some people see it as a benefit to have the entire Angular application in the public folder so that it is easier to handle routing and if it is needed in the future, to completely separate the backend RESTful API and the Angular frontend.

现在return View::make('index')将寻找public/views/index.php 。 完全取决于您希望如何构建应用程序。 有人认为将整个Angular应用程序放在公用文件夹中是有好处的,这样可以更轻松地处理路由,并且如果将来需要,可以将后端RESTful API和Angular前端完全分开。

For Angular routing, then your partial files will be placed in the public folder, but that's out of the scope of this article. For more information on that kind of single page Angular routing, check out Single Page Angular Application Routing.

对于Angular路由,您的部分文件将放置在公用文件夹中,但这不在本文的讨论范围之内。 有关这种单页Angular路由的更多信息,请查看《 单页Angular应用程序路由》 。

Let's assume we left everything default and our main view file is in our app/views folder and move forward.

假设我们将所有内容保留为默认值,并且主视图文件位于app/views文件夹中并继续前进。

Routing with Laravel and Angular There are a lot of questions about having routing with Laravel and Angular and if they conflict. Laravel will handle the main routing for your application. Angular routing will only happen when Laravel routes our user to the main Angular route (使用Laravel和Angular进行路由关于使用Laravel和Angular进行路由以及是否存在冲突,存在很多问题。 Laravel将为您的应用程序处理主要路由。 在这种情况下,只有当Laravel将我们的用户路由到主要的Angular路由( index.php) in this case. This is why we use a Laravel index.php )时,才会发生Angular路由。 这就是为什么我们使用Laravel包罗万象catch-all route. Laravel will handle the API routes and anything it doesn't know how to route will be sent to Angular. You can then set up all the routing for your Angular application to handle showing different views. 路线。 Laravel将处理API路由,所有不知道如何路由的信息都将发送到Angular。 然后,您可以为Angular应用程序设置所有路由,以处理显示不同的视图。

角前端 (The Angular Frontend)

准备好我们的应用程序 (Getting Our Application Ready)

Everything for our Angular application will be handled in the public folder. This let's us keep a good separation of the backend in the app folder.

我们的角应用一切都将在处理public文件夹。 这让我们在app文件夹中保持后端的良好隔离。

Let's look at the application structure we will have in our public folder. We've created our Angular application to be modular since that is best practices. Now our separated parts of our application will be easy to test and work with.

让我们看一下public文件夹中的应用程序结构。 因为这是最佳实践,所以我们已经将Angular应用程序创建为模块化的。 现在,我们应用程序的各个部分将易于测试和使用。

- public/ 
----- js/ 
---------- controllers/ // where we will put our angular controllers 
--------------- mainCtrl.js 
---------- services/ // angular services
--------------- commentService.js 
---------- app.js

Angular服务public / js / services / commentService.js (Angular Service public/js/services/commentService.js)

Our Angular service is going to be the primary place where we will have our HTTP calls to the Laravel API. It is pretty straightforward and we use the Angular $http service.

我们的Angular服务将成为我们对Laravel API进行HTTP调用的主要场所。 这非常简单,我们使用Angular $ http服务。

// public/js/services/commentService.jsangular.module('commentService', []).factory('Comment', function($http) {return {// get all the commentsget : function() {return $http.get('/api/comments');},// save a comment (pass in comment data)save : function(commentData) {return $http({method: 'POST',url: '/api/comments',headers: { 'Content-Type' : 'application/x-www-form-urlencoded' },data: $.param(commentData)});},// destroy a commentdestroy : function(id) {return $http.delete('/api/comments/' + id);}}});

This is our Angular service with 3 different functions. These are the only functions we need since they will correspond to the api routes we made in our Laravel routes.

这是我们的Angular服务,具有3种不同的功能。 这些是我们唯一需要的功能,因为它们将与我们在Laravel路线中创建的api路线相对应。

We will be returning the promise object from our service. These will be dealt with in our controllers. The naming convention here also stays the same as the Laravel controller that we have.

我们将从我们的服务中返回Promise对象。 这些将在我们的控制器中处理。 这里的命名约定也与我们拥有的Laravel控制器相同。

With our Angular Service done, let's go into our controller and use it.

完成Angular Service之后,让我们进入控制器并使用它。

Angular控制器public / js / controllers / mainCtrl.js (Angular Controller public/js/controllers/mainCtrl.js)

The controller is where we will have most of the functionality for our application. This is where we will create functions to handle the submit forms and deleting on our view.

控制器是我们拥有应用程序大部分功能的地方。 在这里,我们将创建用于处理提交表单和在视图上删除的函数。

// public/js/controllers/mainCtrl.jsangular.module('mainCtrl', [])// inject the Comment service into our controller
.controller('mainController', function($scope, $http, Comment) {// object to hold all the data for the new comment form$scope.commentData = {};// loading variable to show the spinning loading icon$scope.loading = true;// get all the comments first and bind it to the $scope.comments object// use the function we created in our service// GET ALL COMMENTS ==============Comment.get().success(function(data) {$scope.comments = data;$scope.loading = false;});// function to handle submitting the form// SAVE A COMMENT ================$scope.submitComment = function() {$scope.loading = true;// save the comment. pass in comment data from the form// use the function we created in our serviceComment.save($scope.commentData).success(function(data) {// if successful, we'll need to refresh the comment listComment.get().success(function(getData) {$scope.comments = getData;$scope.loading = false;});}).error(function(data) {console.log(data);});};// function to handle deleting a comment// DELETE A COMMENT ====================================================$scope.deleteComment = function(id) {$scope.loading = true; // use the function we created in our serviceComment.destroy(id).success(function(data) {// if successful, we'll need to refresh the comment listComment.get().success(function(getData) {$scope.comments = getData;$scope.loading = false;});});};});

As you can see in our controller, we have injected our Comment service and use it for the main functions: get, save, and delete. Using a service like this helps to not pollute our controller with $http gets and puts.

如您在控制器中所见,我们注入了Comment服务,并将其用于主要功能: getsavedelete 。 使用这样的服务有助于避免用$http gets和puts污染我们的控制器。

连接我们的应用程序public / js / app.js (Connecting Our Application public/js/app.js)

On the Angular side of things, we have created our service and our controller. Now let's link everything together so that we can apply it to our application using ng-app and ng-controller.

在事物的角度方面,我们创建了服务控制器 。 现在,将所有内容链接在一起,以便可以使用ng-appng-controller将其应用于我们的应用程序。

This will be the code to create our Angular application. We will inject the service and controller into. This is best practices since it keeps our application modular and each different part can be testable and extendable.

这将是创建Angular应用程序的代码。 我们将注入服务和控制器。 这是最佳实践,因为它使我们的应用程序保持模块化,并且每个不同的部分都可以测试和扩展。

// public/js/app.jsvar commentApp = angular.module('commentApp', ['mainCtrl', 'commentService']);

That's it! Not much to it. Now we'll actually get to our view where we can see how all these Angular parts work together.

而已! 没什么。 现在,我们实际上进入视图,可以看到所有这些Angular零件如何协同工作。

我们的主视图app / views / index.php (Our Main View app/views/index.php)

So far, after everything we've done up to this point, we still won't be able to see anything in our browser. We will need to define our view file since Laravel in our home route and our catch-all route returns return View::make('index');.

到目前为止,在完成所有操作之后,我们仍然无法在浏览器中看到任何内容。 由于Laravel在我们的本地路线中,我们将需要定义我们的视图文件,而我们的全部路线返回return View::make('index');

Let's go ahead and create that view now. We will be using all the Angular parts that we've created. The main parts that we've created from Angular that we'll use in index.php are:

让我们继续创建该视图。 我们将使用我们创建的所有Angular零件。 我们将在index.php中使用的从Angular创建的主要部分是:

  • ng-app and ng-controller: We'll apply these to our application by attaching them to our body tag

    ng-app和ng-controller :我们会将它们附加到我们的body标签上,将它们应用到我们的应用中
  • ng-repeat: We'll loop over the comments and display them in our template

    ng-repeat :我们将遍历注释并将其显示在模板中
  • submitComment(): We'll attach this function to our form using ng-submit

    SubmitComment() :我们将使用ng-submit将此功能附加到表单中
  • Loading Icons: We'll create a variable called loading. If it is set to true, we'll show a loading icon and hide the comments

    加载图标 :我们将创建一个名为loading的变量。 如果设置为true,我们将显示一个加载图标并隐藏评论
  • deleteComment(): We'll attach this function to a delete link so that we can remove the comment

    deleteComment() :我们将此功能附加到删除链接,以便我们删除注释

Now let's get to the actual code for our view. We'll comment out the main important parts so we can see how everything works together.

现在,让我们进入视图的实际代码。 我们将注释掉主要的重要部分,以便我们可以看到一切如何协同工作。

<!-- app/views/index.php --><!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Laravel and Angular Comment System</title><!-- CSS --><link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"> <!-- load bootstrap via cdn --><link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"> <!-- load fontawesome --><style>body        { padding-top:30px; }form        { padding-bottom:20px; }.comment    { padding-bottom:20px; }</style><!-- JS --><script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script><script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js"></script> <!-- load angular --><!-- ANGULAR --><!-- all angular resources will be loaded from the /public folder --><script src="js/controllers/mainCtrl.js"></script> <!-- load our controller --><script src="js/services/commentService.js"></script> <!-- load our service --><script src="js/app.js"></script> <!-- load our application --></head> 
<!-- declare our angular app and controller --> 
<body class="container" ng-app="commentApp" ng-controller="mainController"> <div class="col-md-8 col-md-offset-2"><!-- PAGE TITLE =============================================== --><div class="page-header"><h2>Laravel and Angular Single Page Application</h2><h4>Commenting System</h4></div><!-- NEW COMMENT FORM =============================================== --><form ng-submit="submitComment()"> <!-- ng-submit will disable the default form action and use our function --><!-- AUTHOR --><div class="form-group"><input type="text" class="form-control input-sm" name="author" ng-model="commentData.author" placeholder="Name"></div><!-- COMMENT TEXT --><div class="form-group"><input type="text" class="form-control input-lg" name="comment" ng-model="commentData.text" placeholder="Say what you have to say"></div><!-- SUBMIT BUTTON --><div class="form-group text-right">   <button type="submit" class="btn btn-primary btn-lg">Submit</button></div></form><!-- LOADING ICON =============================================== --><!-- show loading icon if the loading variable is set to true --><p class="text-center" ng-show="loading"><span class="fa fa-meh-o fa-5x fa-spin"></span></p><!-- THE COMMENTS =============================================== --><!-- hide these comments if the loading variable is true --><div class="comment" ng-hide="loading" ng-repeat="comment in comments"><h3>Comment #{{ comment.id }} <small>by {{ comment.author }}</h3><p>{{ comment.text }}</p><p><a href="#" ng-click="deleteComment(comment.id)" class="text-muted">Delete</a></p></div></div> 
</body> 
</html>

laravel-angular-single-page-application

Now we finally have our view that brings all of the parts we created together. You can go ahead and play around with the application. All the parts should fit together nicely and creating and deleting comments should be done without a page refresh.

现在,我们终于有了将我们创建的所有部分整合在一起的观点。 您可以继续使用该应用程序。 所有部分都应该很好地配合在一起,并且无需刷新页面就可以创建和删除注释。

测试应用 (Testing the Application)

Make sure you take a look at the Github repo to test the application. Here are some quick instructions to get you going.

确保查看Github存储库以测试应用程序。 以下是一些快速说明,可助您一臂之力。

  1. Clone the repo: git clone git@github.com:scotch-io/laravel-angular-comment-app

    克隆git clone git@github.com:scotch-io/laravel-angular-comment-appgit clone git@github.com:scotch-io/laravel-angular-comment-app
  2. Install Laravel: composer install --prefer-dist

    安装Laravel: composer install --prefer-dist
  3. Change your database settings in app/config/database.php

    app/config/database.php更改数据库设置
  4. Migrate your database: php artisan migrate

    迁移数据库: php artisan migrate
  5. Seed your database: php artisan db:seed

    种子数据库: php artisan db:seed
  6. View your application in the browser!

    在浏览器中查看您的应用程序!

结论 (Conclusion)

Hopefully this tutorial gives a good overview of how to start an application using Laravel and Angular. You can bring this farther and create a full application that can handle multiple API calls on the Laravel side, and even create your own Angular routing for multiple pages.

希望本教程能够很好地概述如何使用Laravel和Angular启动应用程序。 您可以更进一步,创建一个完整的应用程序,该应用程序可以处理Laravel端的多个API调用,甚至可以为多个页面创建自己的Angular路由 。

Sound off in the comments if you have any questions or would like to see a specific use case. We can also expand on this demo and start adding different things like editing a comment, user profiles, whatever.

如果您有任何疑问或想查看特定的用例,请在评论中忽略。 我们还可以扩展此演示并开始添加其他内容,例如编辑评论,用户个人资料等等。

翻译自: https://scotch.io/tutorials/create-a-laravel-and-angular-single-page-comment-application

angular单页应用

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 关于angularjs的model的一些问题

    有的时候 在一些页面中 我们会需要用到弹出的模态框&#xff0c;这里主要是使用angularjs的uimodel。 页面效果如下&#xff1a; 首先我们需要在JS的controller中导入$uibModal模块。 HTML <div> <button class"btn" ng-click"openModel(photoId)&quo…...

    2024/4/22 5:22:38
  2. 浅谈angular-ui-bootstrap-modal这个骚东西

    在web项目中经常会使用到模态框这么一个东西&#xff0c;bootstrap的modal模块就可以很简单的实现&#xff0c;其实本人是不太喜欢bootstrap这个框架的&#xff08;美化程度太过简单&#xff09;&#xff0c;没办法&#xff0c;谁让angular对它有很好的支持呢&#xff01; 今天…...

    2024/4/21 3:52:54
  3. AngularJS中使用ngModal模态框

    在AngularJS中使用模态框需要引用的文件&#xff1a; angular.js 1.5.5ui.bootstrap-tpls.js 0.11.2bootstrap.css 3.3.7 需要注意版本要一致&#xff0c;高版本的不支持这种方法&#xff0c;会出错 将需要弹出的模态框的内容写在 script 标签中&#xff0c;指明属性&#xff…...

    2024/4/28 12:45:18
  4. AngularJS - $uibModal - 自定义模态框大小

    文档参考 Modal(ui.bootstrap.modal)的使用&#xff1a;https://www.jianshu.com/p/2cbf835509b1 自定义模态框大小 controller中添加 windowClass:‘modal-class’ 用来增加额外样式&#xff0c;增加 size: ‘lg’ 用来设置默认模态框为大尺寸。 function showModal(type,…...

    2024/4/21 3:52:52
  5. angular 中的modal

    在angular.js的描述里,未曾有modal这个词以及概念,从angular的分层架构上看,更类似于 vm 混合 c独立 的概念,不过最近社区一些爱好者给出了相关的modal定义,类似如下代码: 1 $scope.modal new Modal(var1,var2) 这里的$scope大家应该都很熟悉,modal则是$scope下的一个属性,用…...

    2024/5/7 1:13:28
  6. Angular 中修改bootstrap的模态框(modal)大小

    Angular 中修改bootstrap的模态框(modal)大小 自己瞎搞改width的后果。。。 看官网文档&#xff1a;https://ng-bootstrap.github.io/#/components/modal/examples https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/modal/modal.ts 最终解决&#xff1a; showW…...

    2024/4/20 19:59:27
  7. angularJs 中的ui-bootstrap 插件$uibModal 问题总结

    angualr中使用ui-boostrap 很方面就能使用模态框,但在使用过程中有一些问题. 1.如何向controller传递数据 resolve: { //用来向controller传数据deviceInfo: function () {return data.content;}} 2.如果控制modal框的大小 css中定义 .modal-super-lgs { width: 93%; } 在属…...

    2024/4/20 19:59:26
  8. angularjs 动态显示内容适用于$modal

    1.创建指令 angular.module(app).directive(dynamicElement, ["$compile", function ($compile) {return {restrict: A,link: function (scope, elm, attrs) {$compile(elm.contents())(scope);}} }]);2.使用方法 <div dynamic-element><div id"roleCo…...

    2024/4/20 19:59:25
  9. 原生 Angular 2.x 构建模态框(modal)

    背景 刚接触前端不久, 最近在尝试Angular 2.x, 涉及到模态框(Modal)的使用; 原先AngularJS下生成Modal框注入ui.bootstrap外部依赖即可. 而Angular 2.x下关于模态框的外部依赖大多提及到 ngx-bootstrap, 本人实践过程中在安装此依赖时告警如下: > npm install ngx-bootst…...

    2024/4/21 3:52:52
  10. angular中 modal模态框(可复用)

    可复用的 &#xff08;普通的在function中找&#xff09; &#xff1a; 点击事件之后的函数 $rootScope.confirm function(content, okFn, cancelFn) {var modal $modal({html: true,show: false,templateUrl: views/template/ptteng-confirm-0.0.1.html,controller: functio…...

    2024/4/21 3:52:50
  11. angular ui $modal 使用 option

    $modal是一个可以迅速创建模态窗口的服务&#xff0c;创建部分页&#xff0c;控制器&#xff0c;并关联他们 $modal仅有一个方法open(options) templateUrl&#xff1a;模态窗口的地址template&#xff1a;用于显示html标签scope&#xff1a;一个作用域为模态的内容使用&#x…...

    2024/4/23 10:54:36
  12. angular封装modal,一个modal,多次使用

    2019独角兽企业重金招聘Python工程师标准>>> js: app.directive("modal", ["$timeout", function ($timeout) { return { restrict: "AE", templateUrl: "/template/modal.html", …...

    2024/4/22 4:32:29
  13. angular2 之 form表单

    Angular2 重新设计了全新的表单模块&#xff0c;本文基于 angular rc.4 版本 ng2的表单有三个重要概念 1 FormControl //它封装了表单的inputs项&#xff0c;对外暴露为一个可以操作的FormControl对象 2 Validator //包括了一些常用的表单验证方法和一些工具函数&#xff0c;…...

    2024/4/24 16:33:44
  14. Angular4+杂感及知识点总结

    前言 接触Angular还有两个月这样就要整整满一年了&#xff0c;从一个.net程序员变成了一个前端&#xff0c;在了解了前端的东西之后爱上了前端&#xff0c;怎么说呢&#xff0c;其实对于前端这种侧重数据展示的开发自己本身就喜欢&#xff0c;奈何没有引路人&#xff0c;各种原…...

    2024/4/24 18:54:51
  15. 2019 年 React 学习路线图

    作者 | javinpaul 译者 | 无明 之前我们已经介绍了 2019 年 Vue 学习路线图&#xff0c;而 React 作为当前应用最广泛的前端框架&#xff0c;在 Facebook 的支持下&#xff0c;近年来实现了飞越式的发展&#xff0c;所以&#xff0c;我们将在下文中介绍 2019 年 React 学习路线…...

    2024/4/21 3:52:45
  16. 「React」一文带你了解 Redux

    目录1. Redux 核心概念3. Redux 数据管理3. Redux 适用场景4. Redux 代码组织方式5. Redux API&#xff08;1&#xff09;createStore&#xff08;2&#xff09;Store&#xff08;3&#xff09;State&#xff08;4&#xff09;Action&#xff08;5&#xff09;Action Creator&a…...

    2024/4/25 13:49:44
  17. react必知必会

    目录 一、React16.3之前和之后生命周期的区别&#xff0c;为什么要这样做 1、react16.3之前的生命周期 2、react16.3之后的生命周期 3、为什么发生了生命周期钩子函数的变更呢&#xff1f; 4、React 组件生命周期有哪些不同阶段&#xff1f; 二、React Fribe是什么及工作…...

    2024/4/27 19:50:47
  18. 前端小记及react入门

    1、前端开发的演变 本文介绍前端开发的历史和趋势&#xff0c;帮助大家了解 React 要解决什么问题。 1.1 静态页面阶段 互联网发展的早期&#xff0c;网站的前后端开发是一体的&#xff0c;即前端代码是后端代码的一部分。 后端收到浏览器的请求生成静态页面发送到浏览器 …...

    2024/5/3 13:28:41
  19. Angular学习之个人浅谈

    现如今的前端蓬勃发展&#xff0c;已经产生了各种各样的前端框架。其中比较主流的像Angular、React、Vue等&#xff0c;都是基于MVVM思想开发的前端框架。 为什么选择Angular&#xff1f; 当然是因为公司在用angular了&#xff0c;目前一直在用新的angular。作为开发人员的自己…...

    2024/4/21 3:52:42
  20. react研究

    MV*&组件化开发react专题 react介绍与react代码规范 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OG8yz88q-1571282357731)(en-resource://database/975:1)] 配置了 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(im…...

    2024/5/1 1:10:22

最新文章

  1. 如何从零开始学习数据结构?

    在开始前我有一些资料&#xff0c;是我根据网友给的问题精心整理了一份「数据结构的资料从专业入门到高级教程」&#xff0c; 点个关注在评论区回复“888”之后私信回复“888”&#xff0c;全部无偿共享给大家&#xff01;&#xff01;&#xff01;数据结构 算法&#xff1d;程…...

    2024/5/7 16:46:31
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/7 10:36:02
  3. __dirname 在ES模块中的使用

    前言 ECMAScript模块是 JavaScript 的新标准格式。在Node.js中越来越多的库逐渐从从CommonJS转移到ES模块 注&#xff1a;这里是指“真”ES 模块并不是指代码中 Node.js 中使用 import 写法但是实际被 tsc 转成 commonJS 的形式 但是Node.js ES 开发中此前有一个棘手的问题是获…...

    2024/5/7 13:42:25
  4. 54.螺旋矩阵

    题目描述 给你一个 m 行 n 列的矩阵 matrix &#xff0c;请按照 顺时针螺旋顺序 &#xff0c;返回矩阵中的所有元素。示例 1&#xff1a;输入&#xff1a;matrix [[1,2,3],[4,5,6],[7,8,9]] 输出&#xff1a;[1,2,3,6,9,8,7,4,5] 示例 2&#xff1a;输入&#xff1a;matrix …...

    2024/5/7 9:54:07
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/7 5:50:09
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/7 9:45:25
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/7 14:25:14
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/7 11:36:39
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/4 23:55:17
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/7 9:26:26
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/4 23:55:06
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/4 23:55:16
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/6 21:42:42
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57