12 2014 档案

摘要:Front-end changes:app.js: Uinsg $resource/** * Created by Answer1215 on 12/9/2014. */'use strict';function MainCtrl(People) { var vm = this; vm.... 阅读全文
posted @ 2014-12-28 04:34 Zhentiw 编辑
摘要:This lesson describes what is really happening when you use the angularfactory and how you can make your factories even more dynamic in creation.This ... 阅读全文
posted @ 2014-12-27 23:43 Zhentiw 编辑
摘要:The app structure:Front-end: app.js/** * Created by Answer1215 on 12/9/2014. */'use strict';function MainCtrl(PeopleService) { var vm = this; vm... 阅读全文
posted @ 2014-12-27 05:21 Zhentiw 编辑
摘要:ThengCloakdirective is used to prevent the Angular html template from being briefly displayed by the browser in its raw (uncompiled) form while your a... 阅读全文
posted @ 2014-12-27 02:23 Zhentiw 编辑
摘要:Learn how to manually control how asynchronous requests are handled with the use of promises. Because $http is built to work with promises, we saw a f... 阅读全文
posted @ 2014-12-26 16:34 Zhentiw 编辑
摘要:Using the $http service to make requests to remote servers.categories-model.js:angular.module('eggly.models.categories', []) .service('CategoriesMo... 阅读全文
posted @ 2014-12-26 03:11 Zhentiw 编辑
摘要:If you're in a scenario where you want to disable the auto scrolling, but you want to control the scrolling manually, you can use the anchorscroll ser... 阅读全文
posted @ 2014-12-26 00:26 Zhentiw 编辑
摘要:If you want to use controllers, instead of a link function, you can usebindToController. Egghead.io Tutorials angular.module("ap... 阅读全文
posted @ 2014-12-25 20:22 Zhentiw 编辑
摘要:By default, Angular provides a lot of debug information on the DOM that's only necessary for tools like Protractor and Batarang. Angular 1.3 allows yo... 阅读全文
posted @ 2014-12-25 20:13 Zhentiw 编辑
摘要:1 //search 2 bower search jquery 3 4 bower search jquery | grep formstyler 5 6 //info 7 bower info jquery 8 9 //install (lastest one)10 bower inst... 阅读全文
posted @ 2014-12-22 04:46 Zhentiw 编辑
摘要:Create awrapWithdirective using advanced transclusion techniques.transclude- compile the content of the element and make it available to the directive... 阅读全文
posted @ 2014-12-21 23:43 Zhentiw 编辑
摘要:/** * Created by Answer1215 on 12/21/2014. */angular.module('app', []) .controller('FirstCtrl' , function(){ var vm = this; vm.messag... 阅读全文
posted @ 2014-12-21 22:54 Zhentiw 编辑
摘要:Safely render arbitrary HTML snippets by using ngSanitize and $sce.By default angularJS consider user's input html is danger, so if you want to displa... 阅读全文
posted @ 2014-12-21 05:11 Zhentiw 编辑
摘要:ModelValue and ViewValue: $viewValue: Actual string value in the view. $modelValue: The value in the model that the control is bound to. In Anuglar, i 阅读全文
posted @ 2014-12-20 22:17 Zhentiw 编辑
摘要:A chunk may be used in many pages, different page may require different style.We can use Placeholder to pass in the value.[[+placeholder_name]]For exm... 阅读全文
posted @ 2014-12-19 22:36 Zhentiw 编辑
摘要:Chunk in Modx can cut your template into samll pieces to make code reuseable.[[$chunk_name]]For example we can replace the html header with [[$html_he... 阅读全文
posted @ 2014-12-19 21:51 Zhentiw 编辑
摘要:After uploading javascript, css and images to the assets folder.We try to use Template to customizeour html.First template: We set up some placeholder... 阅读全文
posted @ 2014-12-19 19:32 Zhentiw 编辑
摘要:In Modex, there are three tabs: Resoources, Elements & FilesFirst: 'Files' is the place where to put javascript, css & images. I also want to put font... 阅读全文
posted @ 2014-12-19 19:22 Zhentiw 编辑
摘要:You can use ngModel in your own directives, but there are a few things you'll need to do to get it working properly.ngModel itself is an directive. If... 阅读全文
posted @ 2014-12-19 05:42 Zhentiw 编辑
摘要:Directive can use another directive though 'require' keyword.angular.module('docsTabsExample', []).directive('myTabs', function() { return { restr... 阅读全文
posted @ 2014-12-19 05:21 Zhentiw 编辑
摘要:We have code like:var numbers = [1,2,3];for(var i in numbers){ setTimeout(function(){console.log(numbers[i]); }, 0);}//3//3//3Note:1. function... 阅读全文
posted @ 2014-12-17 18:47 Zhentiw 编辑
摘要:The ui-router library for AngularJS provides the ability to name views within your application. This is useful for dividing up your application into s... 阅读全文
posted @ 2014-12-17 17:03 Zhentiw 编辑
摘要:ui-router has the powerful ability to define abstract states, or states that can't be navigated to, but are useful for defining a set of states with s... 阅读全文
posted @ 2014-12-17 03:30 Zhentiw 编辑
摘要:Introduce to basic $stateProvider.state() with $stateParams services. Understand how nested router works.Key Value:ng-href="#/list/{{item.name}}".stat... 阅读全文
posted @ 2014-12-16 23:42 Zhentiw 编辑
摘要:By default your HTTP requests with the $https service in Angular arenotcached. By setting some options, you can turn caching on./** * Created by Answe... 阅读全文
posted @ 2014-12-15 23:57 Zhentiw 编辑
摘要:TimelineLite is a piece of the Greensock TweenMax library that provides the ability to create sequenced animation with very little code or setup.Key v... 阅读全文
posted @ 2014-12-15 17:41 Zhentiw 编辑
摘要:/* 1. Query Operators*/db.posts.find({ viewsCount: {$get: 1000, $lte: 3000}}, {_id: 0, viewsCount: 1, title: 1})// $indb.posts.find({ categor... 阅读全文
posted @ 2014-12-14 18:09 Zhentiw 编辑
摘要:Directives have dependencies too, and you can use dependency injection to provide services for your directives to use.Bad: If you want to use in anot... 阅读全文
posted @ 2014-12-13 21:26 Zhentiw 编辑
摘要:MongoDB is JSON Document:How to start MongoDB client:mongod //start the servermongo // start the cliHow to restore a database:mongorestorecan create a... 阅读全文
posted @ 2014-12-12 05:11 Zhentiw 编辑
摘要:In the previous code, both categories and bookmarks are binded to $rootscope, or let says the same scope.eggly-app.js:angular.module('Eggly', [ 'ui... 阅读全文
posted @ 2014-12-11 17:39 Zhentiw 编辑
摘要:Browserify allows you to leverage 10s of thousands of javascript modules available in the Node Package Manager (npm) in your browser apps.Notice:// Wh... 阅读全文
posted @ 2014-12-10 20:52 Zhentiw 编辑
摘要:Browserify is a tool that brings node.js style development to the browser.The thing you can see on the node.js cmd line can also be broung up to the b... 阅读全文
posted @ 2014-12-10 20:42 Zhentiw 编辑
摘要:Mongoose allows you to easily select resources by ID from your MongoDB. This is an important aspect to creating an API.Server.js'use strict';var expre... 阅读全文
posted @ 2014-12-10 06:16 Zhentiw 编辑
摘要:Learn how to import data into your MongoDB and then use Express to serve a simple Node.js API.Import data into MongoDB:For exmaple, you have an data.j... 阅读全文
posted @ 2014-12-10 04:23 Zhentiw 编辑
摘要:Using WebStrom can easily debug the Node applcation.For example, we have an Node+Express application.server.js:/** * Created by Answer1215 on 12/9/201... 阅读全文
posted @ 2014-12-10 03:22 Zhentiw 编辑
摘要:With a node package manager's (npm) package.jsonscriptproperty, you can preconfigure common tasks like running unit tests withnpm $SCRIPT_NAME.package... 阅读全文
posted @ 2014-12-09 23:42 Zhentiw 编辑
摘要:CoomonJS modules provide a clean syntax for importing dependencies. This lesson will take a look at the basics of using CommonJS modules.app.jsvar dep... 阅读全文
posted @ 2014-12-09 04:58 Zhentiw 编辑
摘要:npm init:For create package.json file which will recode the dependence.npm install:You can also write like:npm i This is a shortcut way to write npm i... 阅读全文
posted @ 2014-12-09 04:07 Zhentiw 编辑
摘要:Angular overrides quite a few existing HTML elements and attributes. This can be a useful technique in our own applications. We will build a directive... 阅读全文
posted @ 2014-12-09 01:30 Zhentiw 编辑
摘要:Simple Redis CommandsLet's start practicing using the redis key-value store from our node application.Require theredismodule and assign it to a variab... 阅读全文
posted @ 2014-12-06 17:57 Zhentiw 编辑
摘要:Using a Router InstanceLet's refactorapp.jsto use aRouterobject.Create a new router object and assign it to theroutervariable.var router = express.Rou... 阅读全文
posted @ 2014-12-05 00:08 Zhentiw 编辑
摘要:Route InstanceLet's rewrite our cities routes using a Route Instance.Create a newRoute Instancefor the'/cities'URL path and assign it to thecitiesRout... 阅读全文
posted @ 2014-12-04 23:34 Zhentiw 编辑
摘要:Response BodyWhat would the response body be set to on aDELETErequest to/cities/DoesNotExist? Here'sthe linkto thesendStatusfunction source code if yo... 阅读全文
posted @ 2014-12-04 18:09 Zhentiw 编辑
摘要:Parser SetupAssume thebody-parsermiddleware is installed. Now, let's use it in our Express application.npm install body-parserRequire thebody-parsernp... 阅读全文
posted @ 2014-12-04 17:55 Zhentiw 编辑
摘要:Flexible RoutesOur current route only works when the city name argument matches exactly the properties in thecitiesobject. This is a problem. We need ... 阅读全文
posted @ 2014-12-04 17:30 Zhentiw 编辑
摘要:City SearchWe want to create an endpoint that we can use to filter cities. Follow the tasks below to to create this new route.Create a new route forGE... 阅读全文
posted @ 2014-12-04 17:05 Zhentiw 编辑
摘要:Logging MiddlewareHelp finish the following middleware code in thelogger.jsfile:On theresponseobject, listen to the event that's emitted when the resp... 阅读全文
posted @ 2014-12-04 05:19 Zhentiw 编辑
摘要:Mounting MiddlewareGiven an application instance is set to theappvariable, which of the following function calls would you use to mount a middleware c... 阅读全文
posted @ 2014-12-04 05:03 Zhentiw 编辑
摘要:Installing ExpressLet's start building our new Express application by installingExpress. Type the command that installs the latest version for the4.9b... 阅读全文
posted @ 2014-12-03 18:14 Zhentiw 编辑

点击右上角即可分享
微信分享提示