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
ftlcloud(超云)目前正在搞暑假促销,美国圣何塞数据中心的云服务器低至9元/月,系统盘与数据盘分离,支持Windows和Linux,免费防御CC攻击,自带10Gbps的DDoS防御。FTL-超云服务器的主要特色:稳定、安全、弹性、高性能的云端计算服务,快速部署,并且可根据业务需要扩展计算能力,按需付费,节约成本,提高资源的有效利用率。活动地址:https://www.ftlcloud.com...
美国服务器哪家平台好?美国服务器无需备案,即开即用,上线快。美国服务器多数带防御,且有时候项目运营的时候,防御能力是用户考虑的重点,特别是网站容易受到攻击的行业。现在有那么多美国一年服务器,哪家的美国云服务器好呢?美国服务器用哪家好?这里推荐易探云,有美国BGP、美国CN2、美国高防、美国GIA等云服务器,线路优化的不错。易探云刚好就是做香港及美国云服务器的主要商家之一,我们来看一下易探云美国云服...
RAKSmart 商家最近动作还是比较大的,比如他们也在增加云服务器产品,目前已经包含美国圣何塞和洛杉矶机房,以及这个月有新增的中国香港机房,根据大趋势云服务器算是比较技术流的趋势。传统的VPS主机架构方案在技术层面上稍微落后一些,当然也是可以用的。不清楚是商家出于对于传统VPS主机清理库存,还是多渠道的产品化营销,看到RAKSmart VPS主机提供美国、香港和日本机房的半价促销,当然也包括其他...
fusioncharts为你推荐
单击media支持ipad支持ipad三星苹果5ipad上网为什么ipad网速特别慢x-routerX-Router这个软件有什么用win7如何关闭445端口如何关闭WIN7自动配置 IPV4 地址 169.254firefoxflash插件火狐浏览器怎么安装flashwin7还原系统win7怎么初始化系统?系统还原?杀毒软件免费下载2013排行榜杀毒软件排行榜2015有哪些?
火山主机 北京主机 linux空间 bgp双线 hostker 有奖调查 idc资讯 hkg 卡巴斯基试用版 linux使用教程 卡巴斯基是免费的吗 登陆空间 便宜空间 美国凤凰城 免费asp空间 西安主机 工信部网站备案查询 服务器硬件配置 江苏双线 密钥索引 更多