Simple Auth service: import { Injectable } from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs/Observable'; import {User} from '../model/user'; import {BehaviorSubject} from 'rxjs/BehaviorSubject'; im…
Angular中文api:http://docs.ngnice.com/api…
$route -$routeProvider服务 -依赖ngRoute模块 $route能够在路径发生改变的时候,渲染不同的视图,调用不同的控制器.它监测了$location.url(),然后根据路径来匹配相应的路由,路由的定义方法详见$routeProvider的API. $route通常和$routeProvider服务和ngView指令一起使用 依赖: $location$routeParams 方法: reload() 在路由没有改变的时候,再次加载当前路径的路由,重新渲染ng-view…
基于多级反馈环形振荡器的真随机数发生器设计 摘要 真随机数生成器(trng)在加密系统中起着重要的作用.本文提出了一种在现场可编程门阵列(FPGA)上生成真随机数的新方法,该方法以 多级反馈环形振荡器(MSFRO) 的随机抖动为熵源.在传统环形振荡器的基础上,增加了多级反馈结构,扩大了时钟抖动的范围,提高了时钟采样频率和熵源的随机性.与传统的时钟采样结构不同,我们利用MSFRO产生的时钟抖动信号对FPGA的锁相环(PLL)产生的时钟信号进行采样.对得到的输出值进行异或运算,以减小输出值的偏差,提…
ng function angular.bind angular.bootstrap angular.copy angular.element angular.equals angular.extend angular.forEach angular.fromJson angular.identity angular.injector angular.isArray angular.isDate angular.isDefined angular.isElement angular.isFunc…
原api出处: https://docs.angularjs.org/api/ngRoute/service/$routeParams $routeParams 可以获取当前路径参数. 需要ngroute模块被安装. 路径参数是$location.search()和$location.path()的组合. 当$route被匹配的时候,路径参数就会被获取. 在参数名称冲突的情况下,路径参数优先于搜索参数. $routeParams服务保证当路由发生变化时,$routeParams对象的id不会变化…
Bootstrap https://getbootstrap.com/BootstrapVue provides one of the most comprehensive implementations of Bootstrap 4 components and grid system for Vue.js and with extensive and automated WAI-ARIA accessibility markup. https://bootstrap-vue.js.org h…
Web API design 28 minutes to read Most modern web applications expose APIs that clients can use to interact with the application. A well-designed web API should aim to support: Platform independence. Any client should be able to call the API, regardl…
在前面两篇文章中,我介绍了基于IdentityServer4的一个Identity Service的实现,并且实现了一个Weather API和基于Ocelot的API网关,然后实现了通过Ocelot API网关整合Identity Service做身份认证的API请求.今天,我们进入前端开发,设计一个简单的Angular SPA,并在Angular SPA上调用受Ocelot API网关和Identity Service保护的Weather API. 回顾 <Angular SPA基于Ocel…
By Daniel Du With View and Data API, you can hide some elements in viewer by calling "viewer.hide(dbIds)", when the elements are hided, it actually make it transparent with a shallow mark to it, or make it ghosted. It is a nice feature as user p…
After the original order is set, you can still leverage methods on the Angular 2 ViewContainer to reorder the components. This is especially helpful when you want an event to trigger layout changes from your generated components. import { Component,…
时间:2014年12月15日 14:15:10 /** * @license AngularJS v1.3.0-beta.15 * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ (function(window, document, undefined) {'use strict'; /** * @description * * This object provides a utility for produc…
原文地址:http://www.infoq.com/articles/ddd-in-practice Background Domain Driven Design (DDD) is about mapping business domain concepts into software artifacts. Most of the writings and articles on this topic have been based on Eric Evans' book "Domain Dr…
The Module Pattern Modules Modules are an integral piece of any robust application's architecture and typically help in keeping the units of code for a project both cleanly separated and organized. In JavaScript, there are several options for impleme…
Java™ Platform, Standard Edition 7API Specification This document is the API specification for the Java™ Platform, Standard Edition. See: Description Packages  Package Description java.applet Provides the classes necessary to create an applet and the…
官方文档Providers Each web application you build is composed of objects that collaborate to get stuff done.(每一个web应用都是由一些对象“组装”成的,这些对象共同合作,来完成特定的任务)These objects need to be instantiated and wired together for the app to work.(这些对象需要被实例化,然后“组装”在一起来使web应用能…
Angular 4.x 快速入门 Angular 4 快速入门 涉及 Angular 简介.环境搭建.插件表达式.自定义组件.表单模块.Http 模块等 Angular 4 基础教程 涉及 Angular CLI 使用.创建组件.事件.自定义服务. ngFor 指令.Input.Output 装饰器等 Angular 4 指令快速入门 涉及如何创建指令.定义输入属性.事件处理.如何获取宿主元素属性值.如何创建结构指令等 Angular 4 表单快速入门 涉及如何创建表单.表单验证.表单控件状态.…
[译]Android API 规范 译者按: 修改R代码遇到Lint tool的报错,搜到了这篇文档,aosp仓库地址:Android API Guidelines. 58e9b5f Project import generated by Copybara. by Android API Council · 9 months ago c0b835d Initial empty repository by Baligh Uddin · 8 years ago 提交记录显示最近才更新的,是官方的应用…
对Angular 2.0的策略有疑问吗?就在这里提吧.在接下来的这篇文章里,我会解释Angular 2.0的主要特性区域,以及每个变化背后的动机.每个部分之后,我将提供自己在设计过程中的意见和见解,包括我认为仍然需要改进设计的重要部分. 注意:本文所反映是2014年11月6日的状态记录.如果你在较长时间之后读到此文,请检查一下我设计上是否有所变更. AngularJS 1.3 在开始讨论Angular的未来之前,我们先花点时间看看当前的版本.AngularJS 1.3是迄今为止最优的Angula…
ionic 运行过程中动态切换API服务器地址 keywords: ionic,phonegap,cordova,网络制式,动态切换,变更,API,服务器地址,$resource,localstorage,url 场景.需求 场景 APP以项目的形式提供,一个客户需要部署一套服务器,一个APP,所以APP的后台服务器地址不能写死.而且要求如果有wifi且在内网,需要用内网服务器地址,如果用3G或者4G,则需切换为外网服务器地址 需求 APP第一次运行,如果没有设置过服务器地址,需要设置好后台服务…
https://developer.android.com/training/system-ui/navigation.html View decorView = getWindow().getDecorView(); // Hide both the navigation bar and the status bar. // SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as // a ge…
Less Requests, More data; one of the core RESTful API design paradigms is the concept of less API requests should be made with less data yielding larger more complete responses. The cost associated to a transaction is defined primarily by the transpo…
import {Input, Component, View, NgClass} from "angular2/angular2"; @Component({ selector: 'todo-item-render' }) @View({ directives: [NgClass], styles: [` .started{ color: green; } .completed { text-decoration: line-through; } `], template: ` <…
Many Components require different styles based on a set of conditions. Angular 2 helps you style your Components by allows you to define Styles inline, then choosing which styles to use based on the current values in your Controller. import {Componen…
这是一篇学习笔记. angular 5 正式版都快出了, 不过主要是性能升级. 我认为angular 4还是很适合企业的, 就像.net一样. 我用的是windows 10 安装工具: git for windows: 官网很慢, 所以找一个镜像站下载: https://github.com/waylau/git-for-win, 淘宝镜像的速度还是蛮快的: 安装的时候, 建议选择这个, 会添加很多命令行工具: nodejs: 去官网下载就行: https://nodejs.org/en/ 正常…
开始使用Angular写页面 使用WebStorm:版本2018.3.5 官网资料 资料大部分有中文翻译,很不错 速查表:https://www.angular.cn/guide/cheatsheet 风格指南:https://www.angular.cn/guide/styleguide Angular 词汇表:https://www.angular.cn/guide/glossary 路由与导航:https://www.angular.cn/guide/router API 列表:https…
无奈接手了一个旧项目,上一个老哥在Angular项目中大量使用了JQuery来操作DOM,真的是太不讲究了.那么如何优雅的使用Angular的方式来操作DOM呢? 获取元素 1.ElementRef  ---   A wrapper around a native element inside of a View. 在组件的 constructor中注入ElementRef,可以获取到整个组件元素的包裹. @Component({ selector: 'app-test-page', templ…
Angular 个人深究[Angular中的Typescript 装饰器] 最近进入一个新的前端项目,为了能够更好地了解Angular框架,想到要研究底层代码. 注:本人前端小白一枚,文章旨在记录自己的学习过程,如有大神发现错误,也请评论指正. Angular 中的装饰器 当安装好Angular后,打开 文件[/my-app/src/app/app.module.ts] 与文件 [/my-app/src/app/app.component.ts] //app.component.tsimport…
前端当前最火的三大框架当属vue.react以及angular了. 但是在做项目的时候,我们怎么去选择呢?  这里做一个比较,希望大家可以有一个比较清晰的认识. vue与react vue和react是当前最火的两个前端框架,vue的发展很快,但是目前来说,react的生态系统会更强大,世界上使用这个框架的人也很多. 另外,react是facebook官方维护的, 而vue是尤雨溪本人维护的. 并且在其他周边库,如react的react-rouer和redux,是react社区在维护的. 而vu…
oop design 分为以下几个方面: - encapsulation and modularity(封装和模块化) - API/Client interface design(API 接口给调用类者) - Inheritance hierarchy and interfaces(继承和继承的层次关系) 这里先介绍一个modularity模块化: 一个大的系统是很复杂的, 可能包含了很多复杂的部分, 如果编码中的一个部分可以独立出来而被其他部分所使用, 例如之前的cs106中的画火车的例子,…