AngularJSCheatSheetbyProLoserviacheatography.
com/1600/cs/513/Filtersamount|currency[:symbol]Formatsanumberasacurrency(ie$1,234.
56).
date|date[:format]array|filter:expressionSelectsasubsetofitemsfromarray.
Expressiontakesstring|Object|function()data|jsonConvertaJavaScriptobjectintoJSONstring.
array|limitTo:limitCreatesanewarraycontainingonlyaspecifiednumberofelementsinanarray.
text|linkyFindslinksintextinputandturnsthemintohtmllinks.
string|lowercaseConvertsstringtolowercase.
number|number[:fractionSize]Formatsanumberastext.
Iftheinputisnotanumberanemptystringisreturned.
array|orderBy:predicate[:reverse]Predicateisfunction(*)|string|Array.
Reverseisbooleanstring|uppercaseConvertsstringtouppercase.
Youcaninjectthe$filterserviceanddo$filter('filterName')(value[,:optionalParam][,:optionalParam])inuseitinyourjavascript.
Services$anchorScroll$cacheFactorycompiledHtml=$compile(html)(scope)$controller$cookieStore$document$exceptionHandler(exception[,cause])$filter(name)$http[(options)]Services(cont)$httpBackend$injector$interpolate(text[,mustHaveExpression])$locale$location$log$parse(expression)$provide$q$resource(url[,paramDefaults][,actions])$rootElement$rootScope$route$routeParams$routeProvider$sanitize(html)$scopeSee$rootScope$templateCache$timeout(fn[,delay][,invokeApply])$windowDirectiveDefinitionObjectname{string}Nameofthecurrentscope.
Optionaldefaultstothenameatregistration.
priority{integer}SpecifiesordermultipledirectivesapplyonsingleDOMelement(higher=first)terminal{true}CurrentprioritywillbelastsetofdirectivestoexecuteDirectiveDefinitionObject(cont)scope{true|object}True-createchildscope.
Undefined|false-useparentscope.
{}-isolatescope(withspecifiedattributes/scopevariablespassed):@or@attr-bindlocalmodeltovalueofDOMattribute(string),=or=attr-bi-directionalbindingbetweenlocalmodelandtheparentscope,&or&attr-executeanexpressionincontextofparent.
ReferenceattrORassumesmodelofsamenamecontrollerfunction($scope,$element,$attrs,$transclude)Controllerconstructorfunctioninstantiatedbeforepre-linkingphaseandsharedwithotherdirectivesifrequestedbynamerequire{string|array[strings]}Requireanothercontroller(ngModel).
Prefixes:-Don'traiseerror.
^-Lookonparentelementstoorestrict{string:'EACM'}E-Element:.
A-Attribute(default):.
C-Class:.
M-Comment:template{string}Replacecurrentelementwithcontentsandmigratesallattributes/classestemplateUrl{string}SameastemplatebutthetemplateisloadedfromthespecifiedURLreplace{boolean}true:templatereplaceselementinsteadofappendingtransclude{boolean}Compilescontentsonparent(pre-isolate)scope.
UsuallyusedwithngTransclude&templates.
CheatographerProLosercheatography.
com/proloser/www.
DeanSofer.
comDatesThischeatsheetwaspublishedon9thAugust,2012andwaslastupdatedon17thApril,2014.
SponsoredbyReadabilityScore.
comMeasureyourwebsitereadability!
https://readabilityscore.
comAngularJSCheatSheetbyProLoserviacheatography.
com/1600/cs/513/DirectiveDefinitionObject(cont)compilefunction(tElement,tAttrs,fntransclude(function(scope,cloneLinkingFn))returnslink()Fortransformingthetemplate(rare,runoncepertemplateinstance).
linkfunction(scope,iElement,iAttrs,controller)Executedaftertemplateiscloned(runonceperclone).
Containsmostlogic(DOMlisteners,etc).
Controllercanbeanarray.
http://docs.
angularjs.
org/guide/directiveDirectivesng-app="plaintext"ng-bind[-html-unsafe]="expression"ng-bind-template="string{{expression}}string{{expression}}"ng-change="expression"ng-checked="boolean"ng-class[-even|-odd]="string|object"ng-[dbl]click="expression"ng-cloak="boolean"ng-controller="plaintext"ng-disabled="boolean"|ng-form="plaintext"ng-hide|show="boolean"ng-href="plaintext{{string}}"ng-include="string"|ng-init="expression"ng-model="expression"Directives(cont)ng-mouse[down|enter|leave|move|over|up]="e‐xpression"ng-non-bindableng-options="select[aslabel][groupbygroup]for([key,]value)inobject|array"ng-pluralize|ng-readonly="expression"ng-repeat="([key,]value)inobject|array"ng-src="string"ng-style="string|object"ng-submit="expression"ng-switch="expression"|ng-switch-when="plaintext"ng-switch-defaultng-transcludeng-view|ng-bind-html="expression"BoldmeanstheactualdirectiveItalicsmeanoptionalPipesmeaneither|orPlaintextmeansnostringencapsulationmeansnotesorcontextmeantagcomptibilityLackofmeanstheattributecanapplytoanytagModuleconfig(configFn)Usethismethodtoregisterworkwhichneedstobeperformedonmoduleloading.
constant(name,object)Becausetheconstantarefixed,theygetappliedbeforeotherprovidemethods.
controller(name,constructor)directive(name,directiveFactory)factory(name,providerFunction)Module(cont)filter(name,filterFactory)provider(name,providerType)run(initializationFn)Usethismethodtoregisterworkwhichneedstobeperformedwhentheinjectorwithwiththecurrentmoduleisfinishedloading.
service(name,constructor)value(name,object)nameNameofthemodule.
requiresHoldsthelistofmoduleswhichtheinjectorwillloadbeforethecurrentmoduleisloaded.
http://docs.
angularjs.
org/api/angular.
ModuleScopePropertiesandMethods$rootor$rootScopeMovetothetop-most$scope(ng-app)$parentMovetotheimmediateparentofthecurrent$scope$idAutogeneratedUniqueID$destroy(event)Broadcastedwhenascopeanditschildrenarebeingdestroyed$apply(exp)ExecuteslogicwithintheAngularJScontextandrefreshesallmodelschecks.
$broadcast(name,args)Dispatchesaneventnamedownwardstoallchildscopes$destroy()Removesthecurrentscope(andallofitschildren)fromtheparentscopeCheatographerProLosercheatography.
com/proloser/www.
DeanSofer.
comDatesThischeatsheetwaspublishedon9thAugust,2012andwaslastupdatedon17thApril,2014.
SponsoredbyReadabilityScore.
comMeasureyourwebsitereadability!
https://readabilityscore.
com(ContentSecurityPolicy)templatesSuperscriptAngularJSCheatSheetbyProLoserviacheatography.
com/1600/cs/513/ScopePropertiesandMethods(cont)$digest()Processallofthewatchersofthecurrentscopeanditschildren.
Sincewatcherscanchangemodels,theywillcontinuefiringuntilallchangesstop.
BEWAREOFRECURSIVECODE$emit(name,args)Dispatchesaneventnameupwardsthroughthescopehierarchy$eval(expression)Executestheexpressiononthecurrentscopeandreturnstheresult$evalAsync(expression)Executestheexpressiononthecurrentscopeatalaterpointintime$new(isolate)Createsanewchildscope$on(name,listener)Listensoneventsofagiventype$watch(watchExp,listener(newVal,oldVal,scope),objectEquality)Watchamodel(exp)forchangesandfiresthelistenercallback.
Passtrueasathirdargumenttowatchanobject'spropertiestoo.
Thefollowingdirectivescreatechildscopes:ngInclude,ngSwitch,ngRepeat,ngController,uiIf.
CallstothesamengControllerwillcreatemultipleinstancesanddonotsharescopes.
Remembertotraverseupthetreetoaffectprimitivesontheintendedscope:ng-click="$parent.
showPage=true"GlobalFunctionsangular.
bind(self,fn,args)Returnsafunctionwhichcallsfunctionfnboundtoself(selfbecomesthethisforfn).
angular.
bootstrap(element[,modules])Usethisfunctiontomanuallystartupangularapplication.
angular.
copy(source[,destination])Createsadeepcopyofsource,whichshouldbeanobjectoranarray.
angular.
element(element)WrapsarawDOMelementorHTMLstringasajQueryelement.
angular.
equals(o1,o2)Determinesiftwoobjectsortwovaluesareequivalent.
angular.
extend(dst,src)Extendsthedestinationobjectdstbycopyingallofthepropertiesfromthesrcobject(s)todst.
angular.
forEach(obj,iterator[,context])Invokestheiteratorfunctiononceforeachiteminobjcollection,whichcanbeeitheranobjectoranarray.
angular.
fromJson(json)DeserializesaJSONstring.
angular.
identity()Afunctionthatreturnsitsfirstargument.
Thisfunctionisusefulwhenwritingcodeinthefunctionalstyle.
angular.
injector(modules)Createsaninjectorfunctionthatcanbeusedforretrievingservicesaswellasfordependencyinjection.
angular.
isArray(value)DeterminesifareferenceisanArray.
angular.
isDate(value)Determinesifavalueisadate.
GlobalFunctions(cont)angular.
isDefined(value)Determinesifareferenceisdefined.
angular.
isElement(value)DeterminesifareferenceisaDOMelement(orwrappedjQueryelement).
angular.
isFunction(value)DeterminesifareferenceisaFunction.
angular.
isNumber(value)DeterminesifareferenceisaNumber.
angular.
isObject(value)DeterminesifareferenceisanObject.
UnliketypeofinJavaScript,nullsarenotconsideredtobeobjects.
angular.
isString(value)DeterminesifareferenceisaString.
angular.
isUndefined(value)Determinesifareferenceisundefined.
angular.
lowercase(string)Convertsthespecifiedstringtolowercase.
angular.
mockNamespacefrom'angular-mocks.
js'whichcontainstestingrelatedcode.
angular.
module(name[,requires],configFn)Theangular.
moduleisaglobalplaceforcreatingandregisteringAngularmodules.
Requiresargumentalwayscreatesanewmodule.
angular.
noop()Afunctionthatperformsnooperations.
angular.
toJson(obj[,pretty])SerializesinputintoaJSON-formattedstring.
angular.
uppercase(string)Convertsthespecifiedstringtouppercase.
angular.
versionAnobjectthatcontainsinformationaboutthecurrentAngularJSversion.
CheatographerProLosercheatography.
com/proloser/www.
DeanSofer.
comDatesThischeatsheetwaspublishedon9thAugust,2012andwaslastupdatedon17thApril,2014.
SponsoredbyReadabilityScore.
comMeasureyourwebsitereadability!
https://readabilityscore.
comAngularJSCheatSheetbyProLoserviacheatography.
com/1600/cs/513/FormController$pristine$dirty$valid$invalid$errorhttp://docs.
angularjs.
org/api/ng.
directive:form.
FormControllerNgModelController$render()Calledwhentheviewneedstobeupdated.
Itisexpectedthattheuseroftheng-modeldirectivewillimplementthismethod.
$setValidity(validationErrorKey,isValid)$setViewValue(value)$viewValuemixed$modelValuemixed$parsersarrayoffunctionafterreadingvalfromDOMtosanitize/convert/validatethevalue$formattersarrayoffunctionstoconvert/validatethevalue$errorobject$pristineboolean$dirtyboolean$validboolean$invalidbooleanhttp://docs.
angularjs.
org/api/ng.
directive:ngModel.
NgModelControllerDeferredandPromise$q.
all([arrayofpromises])CreatesaDeferredobjectwhichrepresentsataskwhichwillfinishinthefuture.
$q.
defer()CreatesaDeferredobjectwhichrepresentsataskwhichwillfinishinthefuture.
$q.
reject(reason)Createsapromisethatisresolvedasrejectedwiththespecifiedreason$q.
when(value)Wrapsanobjectthatmightbeavalueora(3rdparty)then-ablepromiseintoa$qpromiseDeferred.
resolve(value)ResolvesthederivedpromisewiththevalueDeferred.
reject(reason)RejectsthederivedpromisewiththereasonDeferred.
promisePromiseobjectassociatedwiththisdeferredPromise.
then(successCallback,errorCallback)http://docs.
angularjs.
org/api/ng.
$qCheatographerProLosercheatography.
com/proloser/www.
DeanSofer.
comDatesThischeatsheetwaspublishedon9thAugust,2012andwaslastupdatedon17thApril,2014.
SponsoredbyReadabilityScore.
comMeasureyourwebsitereadability!
https://readabilityscore.
com
iWebFusion(iWFHosting)在部落分享过很多次了,这是成立于2001年的老牌国外主机商H4Y旗下站点,提供的产品包括虚拟主机、VPS和独立服务器租用等等,其中VPS主机基于KVM架构,数据中心可选美国洛杉矶、北卡、本德、蒙蒂塞洛等。商家独立服务器可选5个不同机房,最低每月57美元起,而大流量10Gbps带宽服务器也仅149美元起。首先我们分享几款常规服务器配置信息,以下机器可选择5...
提速啦(www.tisula.com)是赣州王成璟网络科技有限公司旗下云服务器品牌,目前拥有在籍员工40人左右,社保在籍员工30人+,是正规的国内拥有IDC ICP ISP CDN 云牌照资质商家,2018-2021年连续4年获得CTG机房顶级金牌代理商荣誉 2021年赣州市于都县创业大赛三等奖,2020年于都电子商务示范企业,2021年于都县电子商务融合推广大使。资源优势介绍:Ceranetwo...
适逢中国农历新年,RAKsmart也发布了2月促销活动,裸机云、云服务器、VPS主机全场7折优惠,新用户注册送10美元,独立服务器每天限量秒杀最低30.62美元/月起,美国洛杉矶/圣何塞、日本、香港站群服务器大量补货,1-10Gbps大带宽、高IO等特色服务器抄底价格,机器可选大陆优化、国际BGP、精品网及CN2等线路,感兴趣的朋友可以持续关注下。裸机云新品7折,秒杀产品5台/天优惠码:Bare-...
fusioncharts为你推荐
投资者适当性客户端系统平板ipad支持ipad奶粉ios8支持ipadcss3圆角css实现圆角的几种方法是什么?x-routerx-arcsinx的等价无穷小是什么?重庆电信宽带管家重庆电信宽带多少钱一个月谷歌sbSb是什么意思?google分析谷歌的Search Console 和 Google Analytics有何区别
出租服务器 拜登买域名批特朗普 主机屋 韩国俄罗斯 美国主机网 godaddy优惠券 搜狗抢票助手 本网站在美国维护 ca4249 坐公交投2700元 godaddy域名证书 泉州电信 服务器干什么用的 阿里云官方网站 服务器维护 湖南idc 日本代理ip 卡巴斯基官网下载 重庆联通服务器托管 WHMCS 更多