08 2014 档案
摘要:1. Want to use bower you need to have node npm and git. 2. Download node.js and git if you don't have. 3. Add nodejs and git & git cmd into the PATH.
阅读全文
摘要:Egghead Videos Save First Last Phone {{contact.firstNam...
阅读全文
摘要:Idea is set up javascript as an api, then just change html to control the behavor.var app = angular.module("app", ["ngAnimate"]);app.controller("AppCt...
阅读全文
摘要:Egghead Videos Goodbye, fair notificationI'm too young to fade! :(.toggle { -webkit-transition: linear 0.75s; -mo...
阅读全文
摘要:/* We're using CSS transitions for when the enter and move events are triggered for the element that has the .repeated-item class*/.repeated-item....
阅读全文
摘要:Egghead Videos Toggle AnimationSomecontentherevar app = angular.module("app", ["ngAnimate"]);app.controller("AppCtrl", func...
阅读全文
摘要:If you use 'ng-repeat-start' you also should have 'ng-repeat-end'.And the element tag for ng-repeat-start and ng-repeat-end should be sinblings. Eg...
阅读全文
摘要:Egghead Videos var app = angular.module("app", []);app.directive('country', function(){ ...
阅读全文
摘要:AngularJS 1.2.x Does Not Allow Duplicate Keys in RepeatersThis lesson was recorded using an older version of AngularJS. With AngularJS 1.2.x, there ar...
阅读全文
摘要:If you change a route, basic there are four steps before you can see the final reuslt.1. on fire, for exmaple:$location.path("/new");In this step, the...
阅读全文
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr...
阅读全文
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr...
阅读全文
摘要://In the previous example, we show write a promise in the config funciton,//But we can image if the logic get complex, the code would be ugly,//there ...
阅读全文
摘要:Before we see how promise works in contrller. But in contrller it is not a good way to put promises.When you route the page, before the controller get...
阅读全文
摘要:Deferred represents a task that will finish in the future. We can get a new deferred object by calling the defer() function on the $q service.Initiall...
阅读全文
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { // file:///C:/Use...
阅读全文
摘要:Functionail:When user type "password" in the input.The div will toggle class to alert-box alert./** * Created by Answer1215 on 8/23/2014. */var app = ...
阅读全文
摘要:In directive, if setreplace: trueit will replace the directive element in html. Angular Scope & /** * Created by Answer1215 on 8...
阅读全文
摘要:功能》点击title, 可以切换Content的显示/隐藏 templateCache This is content : {{zippy.content}} var app = angular.module("app...
阅读全文
摘要:1. In controller, instead of set funciton to scope, we can set function or atts to this.And then return $scope.ControllerName = this;2. Organization a...
阅读全文
摘要:var app = angular.module("phoneApp", []);app.controller("AppCtrl", function($scope) {});app.directive("panel", function() { return { restric...
阅读全文
摘要:Angular Scope & Click me! var app = angular.module("phoneApp", []);app.controller("AppCtrl", function($scope) { t...
阅读全文
摘要:$(document).ready(function(){ // Get Weather $('button').on('show.weather', function() { var results = $(this).closest('li').find('.results'); results
阅读全文
摘要:$.map function will return the modifies array. $.each function will not new a new array, the old value will still be the same. detach() funciton will
阅读全文
摘要:Angular.js Example {{name}} remove
阅读全文
摘要:Angular.js Example First name: Last name: Hello {{firstName}} {{lastName}} Those pieces is outside angular wor...
阅读全文
摘要:All those e-mail addresses and SHAs are making it hard to see commit messages in your history. Try viewing the log with one commit per line.git log --...
阅读全文
摘要:You've made some commits to a feature branch, but you've also committed a hotfix on master that would make a merge messy. Check out thekennelbranch so...
阅读全文
摘要:/** Remote branch and tags */ $ git checkout -b shopping_cart //switched to a new branch 'shopping_cart' and checkout(Locally) $ git...
阅读全文
摘要:/** Augmentation*/var wartime = true;var ARMORY = (function( war ){{ //add var to the private properties var weaponList = [*list of weapon ob...
阅读全文
摘要:/** Global Imports*/var wartime = true;var ARMORY = (function(){{ //add var to the private properties var weaponList = [*list of weapon objec...
阅读全文
摘要:/** So far, we've seen a module that has only public properties*//*The thing with a namespace is that you have to hope that no oneelse ever uses it...
阅读全文
摘要:Angular Directive var app = angular.module("photoApp", []);app.controller("...
阅读全文
摘要:/** Collaboration basics*/Understand git pull command:$ git pull -->> it does two things 1. $ git fetch //get file from remote ro...
阅读全文
摘要:/** Collaborating*/$ git clone https://github.com/codeschool/git-real.git //copy repo to your local Cloning into 'git-r...
阅读全文
摘要:/** */$ git diff //view the differences, to see what you have changed. ...
阅读全文
摘要:/** LEVEL ONE: In this level, you will learn follow things: 1. How to point which project folder you want GIT to work on!...
阅读全文
摘要:Angular Directive Ctrl Dir ...
阅读全文
摘要:var app = angular.module("drinkApp", []);/** scope:{flavor: "@"} has the same affect as link: function(scope, element, attrs){ scope.flav...
阅读全文
摘要:For have a better understand of Isolate Scope and the notation in scope:{}, we see an example:HTML: Angular Directive ...
阅读全文
摘要:#self aside li{ list-style-type: none;padding:5px;border-bottom: 1px solid #ccc;} #self aside li:last-child{border:0;} To remove last li's border;
阅读全文
摘要:/** Retrieving and using numerical time data*/var rightnow = new Date();console.log(rightnow); //Tue Aug 12 2014 22:07:01 GMT+0300 (FLE Daylight Ti...
阅读全文
摘要://Variable message = "Ready for some Coffee?"alert(message)/*//in Javascriptvar message = "Ready for some Coffee?";alert(message);*//** We can see ...
阅读全文
摘要:Important things to remember: 1. Usually, we create Collection, CollectionViews, Model, View. Collection <--> CollectionViews Moel <--> View 2. Applic
阅读全文
摘要:This demo shows that three directive 'require' from another directive. Angular Directive Superm...
阅读全文
摘要:.sidebar a { display: block; line-height: 40px;}.sidebar .featured,.sidebar .sales { background: url(sidebar.png) no-repeat; padding-left: 50px;}....
阅读全文
摘要:Let's take a closer look at how a browser retrieves and acts on scripts.modern browser can parallel downloading 6 files(style sheets && images)at a ti
阅读全文
摘要:/** Improve you loop code */ var treasureChest = { goldCoins: 10000, magicalItem : "Crown of Speed", necklaces: ["ruby", "pearl", "sapphire", "diamond
阅读全文
摘要:Angular Directive Roll over to load more twitters var app = angular.module("...
阅读全文
摘要:Angular Directive I'm content! app.directive('enter', function(){ return function(scope, elem...
阅读全文
摘要:Directive://Element directiveapp.directive('superman', function(){ return { restrict: "E", template: "Here I am to save the world!", ...
阅读全文
摘要:Angular Binding {{msg.message}} ...
阅读全文
摘要:HTML: Call the funciton on the scope and give the data as param. Angular Binding --> ...
阅读全文
摘要:Refactor the spacing between <header>, <article>, and <aside> so that elements will have a 20px margin above and below, regardless of their order on t
阅读全文
摘要:Refactor theparagraphproperties to use shorthand syntax.p { margin-top: 0; margin-right: 0; margin-bottom: 10px; margin-left: 0; font-family: tah...
阅读全文
摘要:/** Ternary Conditionals */ // //**Bad** // var isArthur = false; var weapon; if(isArthur){ weapon = "Excalibur"; }else{ weapon = "Longsword"; } // //
阅读全文
摘要:Sometime, use can rewrite the toString , valueOf method to make those function more useful: For exmaple, we can make valueOf() function to calcualte t
阅读全文
摘要:binding: 通常可以使用ng-model来做绑定!Scope作用域: Angular Binding --> {{data.message}} ...
阅读全文
摘要:function Fencepost (x, y, postNum){ this.x = x; this.y = y; this.postNum = postNum; this.connectionsTo = []; } Fencepost.prototype = { sendRopeTo: fun
阅读全文
摘要:You can add prototype to any object in Jacascript likes Object, Array, String... prototype 有继承的作用,比如说我有一个String的对象,我可以访问Object的prototype hasPrototype(
阅读全文
摘要:Convert the AppointmentForm view below to use Mustache templating. Make sure you remember to change the <%= %> placeholders with Mustache's {{}} place
阅读全文
摘要:Time to get organized. Dr. Goodparts really hates global scope and has ordered that we only have at most 1 object polluting his precious global scope....
阅读全文
摘要:Our first step is to add a template to the AppointmentForm below. Have the template produce a form with two inputs, one for the title of the appointme
阅读全文
摘要:Below we have our AppointmentsView instance rendering and then taking the rendered HTML and inserting into the$('#app') element. Change the code to in
阅读全文
摘要:Duplication is Bad. Let's DRY (Don't Repeat Yourself) our routes to make /pp:per_page an optional part of the pageroute. var AppRouter = new (Backbone
阅读全文
摘要:如果在一个容器中的子元素使用了position:absolute, 那么他可能会跑出父元素的框架范围。 如果想限定子元素在付元素的框架范围,可以在父元素上加position:relative; 对于一个父元素,比如bigWrapper, mainHeader, mainFooter 可以加上posi
阅读全文
摘要:<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="index.css" /> </head> <div class="db group"> <!-- 在含有float的容器中家group class--> <div id="l" s
阅读全文
摘要:var vehicle1 = {type: "Motorboat", capacity: 6, storedAt: "Ammunition Depot"}; var vehicle2 = {type: "Jet Ski", capacity: 1, storedAt: "Reef Dock"}; v
阅读全文
摘要:// Get /appointments{ "per_page": 10, "page": 1, "total": 50, "appointments": [ { "title": "Ms. Kitty Hairball Treatment", "cankelled": false, "identi
阅读全文
摘要:The good Dr. recently had another team implement the server and they slightly messed up the format of the JSON returned for Appointment data. Instead
阅读全文
摘要:1. Ceate a route Class var AppRouter = Backbone.Router.extend({ }); 2. Add a route name it "show", listene to 'appointments/:id' var AppRouter = Backb
阅读全文
摘要:Border radius: border-radius: Box shadow: box-shadow: Example 1: multi shadows.box{ box-shadow: 1px 1px #000, insert 1px 1px 2px blue; ...
阅读全文
摘要:First, memory is set aside for all necessary variables and declared functions. Function expression never got hosited in Javascirpt. Therefore, you can
阅读全文
摘要:They’ve got a problem with their existing code, which tries to use a closure. Check it out: function assignLaser( shark, sharkList ){ var stationAssig
阅读全文
摘要:function buildCoveTicketMarker(transport){ var passengerNumber = 0; return function(name){ passengerNumber++; alert("Ticket via the " +transport+ "Wel
阅读全文
摘要:Returning a function from a function, complete with variables from an external scope, is called a closure. The entire contents of one of these inner f
阅读全文
摘要:It's finally time to start building out our Appointment app. We're going to be using a collection and a collection view to display a list of appointme
阅读全文
摘要:Define a collection: var AppointmentList = Backbone.Collection.extend({model: Appointment}); RESET the json: var appointments = new AppointmentList();
阅读全文
摘要:The Poplar Puzzle-makers weren’t too impressed. They barely noticed your simple and beautiful array of functions, and were only sort of “meh” on the u
阅读全文
摘要:Now the people at Poplar Puzzles would like you to treat an array of functions like a Queue, passing the result of each function into the next until t
阅读全文
摘要:var parkRides = [["Birch Bumpers", 40], ["Pines Plunge", 55], ["Cedar Coaster", 20], ["Ferris Wheel of Firs". 90]]; var fastPassQueus = ["Cedar Coaste
阅读全文
摘要:As an example, if Jason was riding the roller coaster (and when isn’t he), your goal would be to change his cell from ["Jason", "Millhouse"] to just "
阅读全文
摘要:Inside the Haunted Hickory House file, developers for the Forest of Function Expressions Theme Park have created a declared function called forestFrig
阅读全文
摘要://This will load the code into the memory no matter //you call it or not function diffOfSquares(a,b){ return a*a -b*b; } //This code will only load in
阅读全文
摘要:Dr. Goodparts is pretty flaky and has been cancelling a lot of appointments lately. He's asked for an easy, one-click way to cancel an appointment in
阅读全文
摘要:如上图所示: Server有Data都交给Models处理, 然后由Models给Views Data,让View去告诉DOM如何显示, 然后DOM显示HTML; View events update Models? Models updates change the Views 当Model改变了
阅读全文
摘要:Change the AppointmentView to have a top-level li tag (instead of the default div tag). var AppointmentView = Backbone.View.extend({tagName: 'li'}); M
阅读全文
摘要:Our Appointment model doesn't seem too useful yet. Add two default attributes, title as the string "Checkup", anddate which should default to the curr
阅读全文
摘要:Welcome to the Anatomy of Backbone.js challenges! We're going to be building a simple Appointment app for our friend, Dr. Goodparts. So, let's get sta
阅读全文
摘要:In product.js we have an directive like: app.directive("productReviews", function() { return { restrict: 'E', scope:{ reviewdProd...
阅读全文
摘要:Let's go back to our live-moderation app and add some persistence, first to the questions people ask. Use the lpush command to add new questions to th
阅读全文