Web888.vn
  • Khám phá
  • Kiến thức công nghệ
    • Học lập trình
      • Lập trình C/C++
      • Lập trình HTML
      • Lập trình Javascript
        • ReactJS framework
        • AngularJS framework
      • Cơ sở dữ liệu
        • MySQL – MariaDB
        • Micrsoft SQL Server
        • Extensible Markup Language (XML)
        • JSON
      • Lập trình PHP
        • Lập trình PHP cơ bản
        • Laravel Framework
      • Lập trình Java
        • Java Cơ bản
      • Lập Trình C# Cơ Bản
    • WORDPRESS
      • WordPress cơ bản
      • WordPress nâng cao
      • Chia sẻ WordPress
    • Machine Learning
    • Marketing
      • Google Adwords
      • Facebook Ads
      • Kiến thức khác
    • Tin học văn phòng
      • Microsoft Word
      • Microsoft Excel
  • Kinh doanh online – MMO
    • Tiếp thị liên kết
    • Drop shipping
    • Google Adsense
    • Kiếm tiền youtube
    • Tiền điện tử
    • Thương mại điện tử
  • Chia sẻ IT
    • Chia sẻ phần mềm
    • Review công nghệ
    • Công cụ – tiện ích
      • Kiểm tra bàn phím online
      • Kiểm tra webcam online
  • Kỹ năng sống
Đăng nhập
  • Đăng nhập / Đăng ký

Please enter key search to display results.

Home
  • AngularJS
Animation trong angularJS

Animation trong angularJS

  • 26-04-2022
  • Toanngo92
  • 0 Comments

Animation cung cấp giải pháp để đối tượng chuyển động trong angularJS, giúp tăng trải nghiệm người dùng cho ứng dụng, giúp ứng dụng mượt mà hơn

$ngAnimate

Các bước để bắt đầu sử dụng ngAnimate trong angularJS: tích hợp thư viện angulare-animate.js vào dự án trước khi sử dụng và đưa đối tượng ngAnimate và tham số trong mảng khi khởi tạo ứng dụng ( dependency injection ). Xem ví dụ phía dưới để hiểu cách sử dụng ngAnimate.

Lưu ý: ngAnimate chỉ hoạt động trên phiên bản ổn định 1.2.32 , không hoạt động ở phiên bản mới nhất

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Example animation</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.32/angular.min.js"></script>
    <script src="https://code.angularjs.org/1.2.32/angular-animate.min.js"></script>
    <style>
        div {
            transition: all linear 0.5s;
            background-color: cyan;
            height: 100px;
            width: 100%;
            position: relative;
            top: 0px;
            left: 0px;
        }

        .ng-hide {
            height: 0px;
            width: 0px;
            background-color: transparent;
            top: -200px;
            left: 200px;
        }
    </style>
</head>

<body ng-app="myApp" ng-controller="myController">
    <h2>hide the DIV: <input type="checkbox" ng-model="myModel" /></h2>
    <div ng-hide="myModel"></div>
</body>
<script>
    var app = angular.module('myApp', ['ngAnimate']);
    app.controller('myController', function ($scope) {
        $scope.myModel = false;
    });
</script>
</html>

Bài viết liên quan:

Factory và Service trong angularJS
Cơ chế dependency Injection (cơ chế tiêm phụ thuộc) trong angularJS
Form validation trong angularJS
Route (định tuyến) trong angularJS
Filter (bộ lọc) trong angularJS
Service trong AngularJS và các service giao tiếp với máy chủ
Scope và rootScope trong AngularJS
Directive (chỉ thị) trong angularJS và danh sách các directive
Event handling (xử lý xự kiện) trong angularJS
Cơ chế Data binding trong AngularJS
Expressions (biểu thức) trong AngularJS
Views trong AngularJS

THÊM BÌNH LUẬN Cancel reply

Dịch vụ thiết kế Wesbite

NỘI DUNG MỚI CẬP NHẬT

Events, Delegates và Collections trong C#

Hướng dẫn cấu hình Extension live server tự động tải lại PHP khi cập nhật file trên visual studio code

Cài đặt PHP và giới thiệu kiến thức cơ bản PHP

Mảng và chuỗi trong Java

Namespaces và xử lý ngoại lệ

Giới thiệu

web888.vn là chuyên trang chia sẻ và cập nhật tin tức công nghệ, chia sẻ kiến thức, kỹ năng. Chúng tôi rất cảm ơn và mong muốn nhận được nhiều phản hồi để có thể phục vụ quý bạn đọc tốt hơn !

Liên hệ quảng cáo: [email protected]

Kết nối với web888

© web888.vn - Tech888 Co .Ltd since 2019

Đăng nhập

Trở thành một phần của cộng đồng của chúng tôi!
Registration complete. Please check your email.
Đăng nhập bằng google
Đăng kýBạn quên mật khẩu?

Create an account

Welcome! Register for an account
The user name or email address is not correct.

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy.

Registration confirmation will be emailed to you.
Log in Lost your password?

Reset password

Recover your password
Password reset email has been sent.
The email could not be sent. Possible reason: your host may have disabled the mail function.
A password will be e-mailed to you.
Log in Register
×