shipshapecode/angular-shepherd là dự án TypeScript với 237 sao trong nhóm Frontend. An Angular wrapper for the site tour library Shepherd
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
angular-shepherd is built and maintained by Ship Shape. Contact us for web app consulting, development, and training for your project.
This is an Angular wrapper for the Shepherd, site tour, library. It provides additional functionality, on top of Shepherd, as well.
Compatibility
Angular 8: 0.5.0
Angular 9: 0.6.0
Angular 10: 0.7.0
Angular 11: 11.x
Angular 12: 12.x
Angular 13: 13.x
Angular 14: 14.x
Angular 15: 15.x
Angular 16: 16.x
Angular 17: 17.x
Angular 18: 18.x
Angular 19: 19.x
Angular 20: 20.x
Angular 21: 21.x
This has not been tested in anything but Angular 8+. It may or may not work in previous versions or subsequent versions of Angular. We would love to support multiple versions, if people with more Angular knowledge would be willing to help us out!
Installation
npm install angular-shepherd --save
Usage
NOTE: This may not be the proper Angular way to do everything, as I am not an Angular dev, so please let me know if you have suggestions!
Shepherd ships a single style file, which you will need to include. You can do so by adding it to your angular.json.
Then, you will need to inject the ShepherdService to be able to interact with Shepherd and call addSteps to add your steps, start to start the tour, etc.
You could either do this at the application level, in your application component or on a per component or per route/view basis.
NOTE: It is highly recommended to inject ShepherdService into your app.component.ts. Injecting it at the app level ensures you only create one instance of Shepherd.
In that component you will want to use AfterViewInit to addSteps to the Shepherd service.
import { Component, type AfterViewInit } from '@angular/core';
import { ShepherdService } from 'angular-shepherd';
import { steps as defaultSteps, defaultStepOptions } from '../data';
@Component({
selector: 'shepherd',
templateUrl: './shepherd.component.html',
styleUrls: ['./shepherd.component.css']
})
export class ShepherdComponent implements AfterViewInit {
constructor(private shepherdService: ShepherdService) {}
ngAfterViewInit() {
this.shepherdService.defaultStepOptions = defaultStepOptions;
this.shepherdService.modal = true;
this.shepherdService.confirmCancel = false;
this.shepherdService.addSteps(defaultSteps);
this.shepherdService.start();
}
}
Configuration
The following configuration options can be set on the ShepherdService to control the way that Shepherd is used. The only required option is steps, which is set via addSteps.
confirmCancel
confirmCancel is a boolean flag, when set to true it will pop up a native browser confirm window on cancel, to ensure you want to cancel.
confirmCancelMessage
confirmCancelMessage is a string to display in the confirm dialog when confirmCancel is set to true.
defaultStepOptions
defaultStepOptions is used to set the options that will be applied to each step by default. You can pass in any of the options that you can with Shepherd.
⚠️ You must set defaultStepOptionsBEFORE calling addSteps to set the steps.
requiredElements is an array of objects that indicate DOM elements that are REQUIRED by your tour and must exist and be visible for the tour to start. If any elements are not present, it will keep the tour from starting.
You can also specify a message, which will tell the user what they need to do to make the tour work.
⚠️ You must set requiredElementsBEFORE calling addSteps to set the steps.
Example
this.shepherdService.requiredElements = [
{
selector: '.search-result-element',
message: 'No search results found. Please execute another search, and try to start the tour again.',
title: 'No results'
},
{
selector: '.username-element',
message: 'User not logged in, please log in to start this tour.',
title: 'Please login'
}
];
default value:[]
modal
modal is a boolean, that should be set to true, if you would like the rest of the screen, other than the current element, greyed out, and the current element highlighted. If you do not need modal functionality, you can remove this option or set it to false.
default value:false
addSteps
You must pass an array of steps to addSteps, something like this:
In Shepherd, you can have as many buttons as you want inside a step. You can build an object with some premade buttons, making it easier to manipulate and insert in new steps. Buttons by default accept three different types: back, cancel, next. In this simple example, we have three buttons: each one with different types and classes.
Buttons have an action property, which must be a function. Whenever the button is clicked, the function will be executed. You can use it for default shepherd functions, like this.shepherdService.complete() or this.shepherdService.next(), or create your own function to use for the action.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/shipshapecode/angular-shepherd là nguồn chính thức.
shipshapecode/angular-shepherd có bao nhiêu sao?
shipshapecode/angular-shepherd có 237 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/shipshapecode/angular-shepherd. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
shipshapecode/angular-shepherd có những chủ đề gì?
GitHub topics của shipshapecode/angular-shepherd: "angular", "angularjs", "hacktoberfest", "shepherd", "tour". TopGit xếp repo vào nhóm Frontend.
shipshapecode/angular-shepherd có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho shipshapecode/angular-shepherd. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
shipshapecode/angular-shepherd còn đang phát triển không?
Commit gần nhất trên shipshapecode/angular-shepherd là 11 ngày trước (theo timestamp GitHub). Repo có 49 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
shipshapecode/angular-shepherd viết bằng ngôn ngữ gì?
shipshapecode/angular-shepherd chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về angular-shepherd?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về angular-shepherd.