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
CloudCone的[2021 Flash Sale]活动仍在继续,针对独立服务器、VPS或者Hosted email,其中VPS主机基于KVM架构,最低每月1.99美元,支持7天退款到账户,可使用PayPal或者支付宝付款,先充值后下单的方式。这是一家成立于2017年的国外VPS主机商,提供独立服务器租用和VPS主机,其中VPS基于KVM架构,多个不同系列,也经常提供一些促销套餐,数据中心在洛杉...
virmach这是第二波出这种一次性周期的VPS了,只需要缴费1一次即可,用完即抛,也不允许你在后面续费。本次促销的是美国西海岸的圣何塞和美国东海岸的水牛城,周期为6个月,过后VPS会被自动且是强制性取消。需要临时玩玩的,又不想多花钱的用户,可以考虑下!官方网站:https://www.virmach.comTemporary Length Service Specials圣何塞VPS-一次性6个...
看到群里网友们在讨论由于不清楚的原因,有同学的网站无法访问。他的网站是没有用HTTPS的,直接访问他的HTTP是无法访问的,通过PING测试可以看到解析地址已经比较乱,应该是所谓的DNS污染。其中有网友提到采用HTTPS加密证书试试。因为HTTP和HTTPS走的不是一个端口,之前有网友这样测试过是可以缓解这样的问题。这样通过将网站绑定设置HTTPS之后,是可以打开的,看来网站的80端口出现问题,而...
fusioncharts为你推荐
支持ipad支持ipad支持ipad支持ipad支持ipad支持ipadeacceleratoreaccelerator.shm_size设置多少合适呢?canvas2动漫cv井口裕香,都有哪些作品?css3按钮HTML中,怎么表示一个图片按钮chromeframechrome需要frame吗
广东vps hostgator ixwebhosting 英文站群 qq对话框 100mbps ebay注册 阿里云免费邮箱 贵阳电信 zencart安装 hosts文件修改 卡巴斯基免费版 dns是什么意思 ddos防火墙 主机托管 电脑主机响 主机系统 主机声音大 sockscap怎么用 好看的空间留言代码 更多