New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

angular-tiny

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-tiny

a frontend starter

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Angular-tiny

Angular-tiny是一个类AngularJS的迷你框架, 实现了双向数据绑定,模板解析, 组件化等前端框架必备的部分,同时内置了HTTP服务等模块,方便开发者.

⚠ 此项目仅作为个人探究前端框架学习的总结,不建议在生产环境中的使用

快速上手

安装

yarn add angular-tiny

实现基本的counter app

html部分

<!DOCTYPE html>
<html>
<head>
</head>
<body ng-app="myCounterApp">
  <div ng-controller="CounterController as ctrl">
    {{ctrl.counter}}
    <button ng-click="ctrl.increment()">+</button>
    <button ng-click="ctrl.decrement()">-</button>
  </div>
  <script src="../dist/angular-tiny.js"></script>
  <script src="counter.js"></script>
</body>
</html>

js部分

angular.module('myCounterApp', []).controller('CounterController', function() {
  this.counter = 1
  this.increment = function() {
    this.counter++
  }
  this.decrement = function() {
    this.counter--
  }
})

Done/Todo

  • scope继承
  • 依赖注入系统
  • Promise服务模块
  • Http服务模块
  • 指令,插值绑定及组件化
  • ngModel, ngSwitch等指令
  • 路由模块

参考资料

  • build-your-own-angularJS

  • Javascript框架设计

Keywords

frontend

FAQs

Package last updated on 28 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts