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. 阅读全文
posted @ 2014-08-31 05:13 Zhentiw 编辑
摘要:Egghead Videos Save First Last Phone {{contact.firstNam... 阅读全文
posted @ 2014-08-30 20:11 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-28 16:57 Zhentiw 编辑
摘要:Egghead Videos Goodbye, fair notificationI'm too young to fade! :(.toggle { -webkit-transition: linear 0.75s; -mo... 阅读全文
posted @ 2014-08-28 02:19 Zhentiw 编辑
摘要:/* 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.... 阅读全文
posted @ 2014-08-27 16:01 Zhentiw 编辑
摘要:Egghead Videos Toggle AnimationSomecontentherevar app = angular.module("app", ["ngAnimate"]);app.controller("AppCtrl", func... 阅读全文
posted @ 2014-08-27 03:29 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-27 02:18 Zhentiw 编辑
摘要:Egghead Videos var app = angular.module("app", []);app.directive('country', function(){ ... 阅读全文
posted @ 2014-08-27 01:42 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-26 17:53 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-26 16:55 Zhentiw 编辑
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr... 阅读全文
posted @ 2014-08-26 03:46 Zhentiw 编辑
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { templateUr... 阅读全文
posted @ 2014-08-26 03:37 Zhentiw 编辑
摘要://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 ... 阅读全文
posted @ 2014-08-26 02:16 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-26 01:56 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-25 22:08 Zhentiw 编辑
摘要:var app = angular.module("app", ["ngRoute"]);app.config(function ($routeProvider) { $routeProvider .when('/', { // file:///C:/Use... 阅读全文
posted @ 2014-08-25 17:21 Zhentiw 编辑
摘要: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 = ... 阅读全文
posted @ 2014-08-25 17:06 Zhentiw 编辑
摘要:In directive, if setreplace: trueit will replace the directive element in html. Angular Scope & /** * Created by Answer1215 on 8... 阅读全文
posted @ 2014-08-25 16:40 Zhentiw 编辑
摘要:功能》点击title, 可以切换Content的显示/隐藏 templateCache This is content : {{zippy.content}} var app = angular.module("app... 阅读全文
posted @ 2014-08-24 21:02 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-24 05:26 Zhentiw 编辑
摘要:var app = angular.module("phoneApp", []);app.controller("AppCtrl", function($scope) {});app.directive("panel", function() { return { restric... 阅读全文
posted @ 2014-08-24 05:05 Zhentiw 编辑
摘要:Angular Scope & Click me! var app = angular.module("phoneApp", []);app.controller("AppCtrl", function($scope) { t... 阅读全文
posted @ 2014-08-23 23:45 Zhentiw 编辑
摘要:$(document).ready(function(){ // Get Weather $('button').on('show.weather', function() { var results = $(this).closest('li').find('.results'); results 阅读全文
posted @ 2014-08-22 04:00 Zhentiw 编辑
摘要:$.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 阅读全文
posted @ 2014-08-22 01:11 Zhentiw 编辑
摘要:Angular.js Example First name: Last name: Hello {{firstName}} {{lastName}} Those pieces is outside angular wor... 阅读全文
posted @ 2014-08-19 14:20 Zhentiw 编辑
摘要: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 --... 阅读全文
posted @ 2014-08-18 02:03 Zhentiw 编辑
摘要: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... 阅读全文
posted @ 2014-08-17 22:22 Zhentiw 编辑
摘要:/** Remote branch and tags */ $ git checkout -b shopping_cart //switched to a new branch 'shopping_cart' and checkout(Locally) $ git... 阅读全文
posted @ 2014-08-17 21:59 Zhentiw 编辑
摘要:/** Augmentation*/var wartime = true;var ARMORY = (function( war ){{ //add var to the private properties var weaponList = [*list of weapon ob... 阅读全文
posted @ 2014-08-17 20:31 Zhentiw 编辑
摘要:/** Global Imports*/var wartime = true;var ARMORY = (function(){{ //add var to the private properties var weaponList = [*list of weapon objec... 阅读全文
posted @ 2014-08-17 20:30 Zhentiw 编辑
摘要:/** 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... 阅读全文
posted @ 2014-08-17 20:28 Zhentiw 编辑
摘要:Angular Directive var app = angular.module("photoApp", []);app.controller("... 阅读全文
posted @ 2014-08-17 19:10 Zhentiw 编辑
摘要:/** Collaboration basics*/Understand git pull command:$ git pull -->> it does two things 1. $ git fetch //get file from remote ro... 阅读全文
posted @ 2014-08-15 21:53 Zhentiw 编辑
摘要:/** Collaborating*/$ git clone https://github.com/codeschool/git-real.git //copy repo to your local Cloning into 'git-r... 阅读全文
posted @ 2014-08-15 21:52 Zhentiw 编辑
摘要:/** */$ git diff //view the differences, to see what you have changed. ... 阅读全文
posted @ 2014-08-15 21:50 Zhentiw 编辑
摘要:/** LEVEL ONE: In this level, you will learn follow things: 1. How to point which project folder you want GIT to work on!... 阅读全文
posted @ 2014-08-15 21:49 Zhentiw 编辑
摘要:Angular Directive Ctrl Dir ... 阅读全文
posted @ 2014-08-14 17:15 Zhentiw 编辑
摘要:var app = angular.module("drinkApp", []);/** scope:{flavor: "@"} has the same affect as link: function(scope, element, attrs){ scope.flav... 阅读全文
posted @ 2014-08-14 16:51 Zhentiw 编辑
摘要:For have a better understand of Isolate Scope and the notation in scope:{}, we see an example:HTML: Angular Directive ... 阅读全文
posted @ 2014-08-14 15:17 Zhentiw 编辑
摘要:#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; 阅读全文
posted @ 2014-08-14 04:34 Zhentiw 编辑
摘要:/** 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... 阅读全文
posted @ 2014-08-14 03:43 Zhentiw 编辑
摘要://Variable message = "Ready for some Coffee?"alert(message)/*//in Javascriptvar message = "Ready for some Coffee?";alert(message);*//** We can see ... 阅读全文
posted @ 2014-08-14 03:41 Zhentiw 编辑
摘要:Important things to remember: 1. Usually, we create Collection, CollectionViews, Model, View. Collection <--> CollectionViews Moel <--> View 2. Applic 阅读全文
posted @ 2014-08-14 03:39 Zhentiw 编辑
摘要:This demo shows that three directive 'require' from another directive. Angular Directive Superm... 阅读全文
posted @ 2014-08-14 03:24 Zhentiw 编辑
摘要:.sidebar a { display: block; line-height: 40px;}.sidebar .featured,.sidebar .sales { background: url(sidebar.png) no-repeat; padding-left: 50px;}.... 阅读全文
posted @ 2014-08-13 05:26 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-12 20:42 Zhentiw 编辑
摘要:/** Improve you loop code */ var treasureChest = { goldCoins: 10000, magicalItem : "Crown of Speed", necklaces: ["ruby", "pearl", "sapphire", "diamond 阅读全文
posted @ 2014-08-12 20:26 Zhentiw 编辑
摘要:Angular Directive Roll over to load more twitters var app = angular.module("... 阅读全文
posted @ 2014-08-12 19:00 Zhentiw 编辑
摘要:Angular Directive I'm content! app.directive('enter', function(){ return function(scope, elem... 阅读全文
posted @ 2014-08-12 17:30 Zhentiw 编辑
摘要:Directive://Element directiveapp.directive('superman', function(){ return { restrict: "E", template: "Here I am to save the world!", ... 阅读全文
posted @ 2014-08-12 17:12 Zhentiw 编辑
摘要:Angular Binding {{msg.message}} ... 阅读全文
posted @ 2014-08-11 18:38 Zhentiw 编辑
摘要:HTML: Call the funciton on the scope and give the data as param. Angular Binding --> ... 阅读全文
posted @ 2014-08-11 16:07 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-11 04:43 Zhentiw 编辑
摘要:Refactor theparagraphproperties to use shorthand syntax.p { margin-top: 0; margin-right: 0; margin-bottom: 10px; margin-left: 0; font-family: tah... 阅读全文
posted @ 2014-08-11 04:19 Zhentiw 编辑
摘要:/** Ternary Conditionals */ // //**Bad** // var isArthur = false; var weapon; if(isArthur){ weapon = "Excalibur"; }else{ weapon = "Longsword"; } // // 阅读全文
posted @ 2014-08-11 03:45 Zhentiw 编辑
摘要:Sometime, use can rewrite the toString , valueOf method to make those function more useful: For exmaple, we can make valueOf() function to calcualte t 阅读全文
posted @ 2014-08-11 02:53 Zhentiw 编辑
摘要:binding: 通常可以使用ng-model来做绑定!Scope作用域: Angular Binding --> {{data.message}} ... 阅读全文
posted @ 2014-08-10 19:57 Zhentiw 编辑
摘要:function Fencepost (x, y, postNum){ this.x = x; this.y = y; this.postNum = postNum; this.connectionsTo = []; } Fencepost.prototype = { sendRopeTo: fun 阅读全文
posted @ 2014-08-10 17:59 Zhentiw 编辑
摘要:You can add prototype to any object in Jacascript likes Object, Array, String... prototype 有继承的作用,比如说我有一个String的对象,我可以访问Object的prototype hasPrototype( 阅读全文
posted @ 2014-08-10 02:32 Zhentiw 编辑
摘要:Convert the AppointmentForm view below to use Mustache templating. Make sure you remember to change the <%= %> placeholders with Mustache's {{}} place 阅读全文
posted @ 2014-08-09 17:52 Zhentiw 编辑
摘要: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.... 阅读全文
posted @ 2014-08-09 17:19 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-09 03:25 Zhentiw 编辑
摘要:Below we have our AppointmentsView instance rendering and then taking the rendered HTML and inserting into the$('#app') element. Change the code to in 阅读全文
posted @ 2014-08-08 22:35 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-08 21:08 Zhentiw 编辑
摘要:如果在一个容器中的子元素使用了position:absolute, 那么他可能会跑出父元素的框架范围。 如果想限定子元素在付元素的框架范围,可以在父元素上加position:relative; 对于一个父元素,比如bigWrapper, mainHeader, mainFooter 可以加上posi 阅读全文
posted @ 2014-08-08 15:25 Zhentiw 编辑
摘要:<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="index.css" /> </head> <div class="db group"> <!-- 在含有float的容器中家group class--> <div id="l" s 阅读全文
posted @ 2014-08-08 03:34 Zhentiw 编辑
摘要:var vehicle1 = {type: "Motorboat", capacity: 6, storedAt: "Ammunition Depot"}; var vehicle2 = {type: "Jet Ski", capacity: 1, storedAt: "Reef Dock"}; v 阅读全文
posted @ 2014-08-08 00:31 Zhentiw 编辑
摘要:// Get /appointments{ "per_page": 10, "page": 1, "total": 50, "appointments": [ { "title": "Ms. Kitty Hairball Treatment", "cankelled": false, "identi 阅读全文
posted @ 2014-08-07 18:56 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-07 16:38 Zhentiw 编辑
摘要:1. Ceate a route Class var AppRouter = Backbone.Router.extend({ }); 2. Add a route name it "show", listene to 'appointments/:id' var AppRouter = Backb 阅读全文
posted @ 2014-08-07 14:04 Zhentiw 编辑
摘要:Border radius: border-radius: Box shadow: box-shadow: Example 1: multi shadows.box{ box-shadow: 1px 1px #000, insert 1px 1px 2px blue; ... 阅读全文
posted @ 2014-08-06 17:57 Zhentiw 编辑
摘要:First, memory is set aside for all necessary variables and declared functions. Function expression never got hosited in Javascirpt. Therefore, you can 阅读全文
posted @ 2014-08-05 16:21 Zhentiw 编辑
摘要:They’ve got a problem with their existing code, which tries to use a closure. Check it out: function assignLaser( shark, sharkList ){ var stationAssig 阅读全文
posted @ 2014-08-04 20:57 Zhentiw 编辑
摘要:function buildCoveTicketMarker(transport){ var passengerNumber = 0; return function(name){ passengerNumber++; alert("Ticket via the " +transport+ "Wel 阅读全文
posted @ 2014-08-04 20:15 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-04 18:33 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-04 05:13 Zhentiw 编辑
摘要:Define a collection: var AppointmentList = Backbone.Collection.extend({model: Appointment}); RESET the json: var appointments = new AppointmentList(); 阅读全文
posted @ 2014-08-02 21:28 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-02 20:52 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-02 20:29 Zhentiw 编辑
摘要:var parkRides = [["Birch Bumpers", 40], ["Pines Plunge", 55], ["Cedar Coaster", 20], ["Ferris Wheel of Firs". 90]]; var fastPassQueus = ["Cedar Coaste 阅读全文
posted @ 2014-08-02 19:50 Zhentiw 编辑
摘要: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 " 阅读全文
posted @ 2014-08-02 18:00 Zhentiw 编辑
摘要:Inside the Haunted Hickory House file, developers for the Forest of Function Expressions Theme Park have created a declared function called forestFrig 阅读全文
posted @ 2014-08-02 17:23 Zhentiw 编辑
摘要://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 阅读全文
posted @ 2014-08-02 16:37 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-01 21:57 Zhentiw 编辑
摘要:如上图所示: Server有Data都交给Models处理, 然后由Models给Views Data,让View去告诉DOM如何显示, 然后DOM显示HTML; View events update Models? Models updates change the Views 当Model改变了 阅读全文
posted @ 2014-08-01 21:09 Zhentiw 编辑
摘要:Change the AppointmentView to have a top-level li tag (instead of the default div tag). var AppointmentView = Backbone.View.extend({tagName: 'li'}); M 阅读全文
posted @ 2014-08-01 20:45 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-01 19:10 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-01 17:52 Zhentiw 编辑
摘要:In product.js we have an directive like: app.directive("productReviews", function() { return { restrict: 'E', scope:{ reviewdProd... 阅读全文
posted @ 2014-08-01 17:26 Zhentiw 编辑
摘要: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 阅读全文
posted @ 2014-08-01 01:59 Zhentiw 编辑

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