Coffeescript----> Install node. js----> Installation Coffeescript Statement:Note: There is no semicolon, the statement ends with a new line; multiple statements written to the same row require semicolons to denote the end of a statement (not commonly used);Continuation to the next line by adding \ Representation statements at the end of a row; Variable:Unlike JS, coff
install Coffeescript in node. js1. My node. JS installation directory2.node.js Global Module Directory 3.node.js installation Coffeescript1 npm install-g coffee-scriptAt this point node. JS has been installed in the Coffeescript compiler, but I encountered a second installation problem, is the-w parameter will be error, Error:watch einval I in the first installation, did not encounter any problems, but at t
-size:2em
Became a SCSS in theSCSS Code
. content{
Margin:2em 0;
h1 {Font-size:2em}
}
In the writing, more incomparable intuitive, but also can put the old CSS directly into, completely no problem! SCSS has added a lot of feature functions about CSS3.Take my favorite background gradient to be good, the original to do gradient, CSS must be written like this:SCSS Code
#linear-gradient {
Background-image:-webkit-gradient (linear, 0% 0, 100% 100%, Color-stop (0,
. Content
Margin:2em 0
H1
Font-size:2em
Became a SCSS in theSCSS Code
. content{
Margin:2em 0;
h1 {Font-size:2em}
}
In the writing, more incomparable intuitive, but also can put the old CSS directly into, completely no problem! SCSS has added a lot of feature functions about CSS3.Take my favorite background gradient to be good, the original to do gradient, CSS must be written like this:SCSS Code
#linear-gradient {
Background-image:-webk
For example, write the coffee file in the coffee/controller/folder, create a new Js/controller folder, use the grunt to run the project, will automatically compile coffee to the corresponding JS folder.Module.exports = function (grunt) {//project configuration information. Grunt.initconfig ({pkg:grunt.file.readJSON (' Package.json '), Jshint: {options: {jshintrc: '. Jshintrc ') ,//Eqeqeq:true,//Tradiling:true, ignores: [' Node_modules/**/*.js ']}, all: [' **/*.js ' ]}, coffee:{compile: {options:
CoffeeScript demo, coffeescriptdemo# Coffee-script.js resolution xx. coffee script can be embedded directly in the browser, but it is not recommended to use it in real time, coffee-script.js: http://coffeescript.org/extras/coffee-script.js# To locally install coffee, compile xx. coffee into xx. js. Command: coffee-c xx. coffee# VARIABLESMyVar = 1# ArrayMyArray = [1, 2, 3, 4, 5]# ObjectLeader =Name: "wj"Age: 25Alert (leader. name)# Function if x = null
Start to see
The code is as follows
Copy Code
Run = (A, b)-> # define the Run functionCode hearRun 1, 2 # Pass parameters 1, 2 to the Run function and execute, omitting the parenthesesRun (1, 2) # Pass parameters 1, 2 to the Run function and execute, with parentheses
Of course, you can also change the parameters of the line to write, such as:
The code is as follows
Copy Code
Run 1,2Run 1, 2Run (1,2)Run (1, 2)
As long a
As you may see, Xiaosheng is currently working on front-end automation. It is very productive and worth it. Don't forget it. At the same time, it provides a road sign for the future.
Operating System: Win8
Editor: sublime
Install plug-ins
A Ctrl + Shift + P, enter install, press enter,
B input coffeecompile
2. Install Node
3. Install grunt. Command: NPM install-G grunt-cli
Install coffee-script. Command: NPM install-g coffee-script
4. Download jashkenas-
Sublime Text compilation CoffeeScript error solution, sublimecoffeescript
Try todaySublime TextCompileCoffeeScript The CoffeeScript plug-in is installed first, and then a CoffeeScript is added to the compiler, but an error is prompted when trying to compile the code, and then the Internet looks for a solution without solution... So I tried to change the SublimeT
Coffeescript is a little language that compiles into Javascript. The Code compiles one-to-one into the equivalent JS, and there is not InterpretationAt runtime. You can use any existing JavaScript library seamlessly (and vice-versa ).
The syntax of coffeescript is too red by ruby and python, and implements extends features from those two ages. This introduction references the little bookOn
About Sonarlanguage is what dongdong, here is not described, if you are interested in it, please go to the previous essay open Source: angularjs example--sonar Project use language map. Here is a recent practice version of learning Coffeescript.
Coffeescript is a concise, JavaScript-based preprocessor language that can be statically compiled into JavaScript, which is primarily influenced by Ruby and Python
Two days ago looked at Coffeescript, based on node. JS, incidentally Configure a node environment bar, toss for a long time1. Download the MSI installation Environment from node. jsAfter the installation is complete open the installation directory, you can see a node.exe open can be executed in the JS code, similar to the chrome console, attention is not executed here node command! All of the following execution environments are cmd.Open cmd, input no
More and more people begin to use less and other pre-processor methods to write CSS and JavaScript. The popular ones are less, sass, and coffeescript. LessCodeIt cannot be executed directly in the browser. In the end, it still needs to be compiled into CSS or Js. Their syntax is great, but their compilation methods are not flexible enough. Basically, the official website only provides the command line method for file compilation. Less can also embed a
In terms of inheritance, js is still weak. It is found that constructor and initialize are divided during inheritance. The relationship between the two is not described in online articles. After reading the source code, we can see the difference between the two. First, I used coffeescript to implement js inheritance. A problem was found during the process. By using Backb... SyntaxHighlighter.
In terms of inheritance, js is still weak. It is found that
Koala v1.3.0 has been released. You are welcome to download and use it.
: Http://koala-app.com/index-zh.html
Update description:
New Feature: allows you to directly use the compiledProgram.New Function: Right-click the menu and add the "open file" option.Set the default output path to the CSS/JS directory under the same directory as the project directory, such as./less->./CSS.Fixed the bug: A compilation error occurred when the directory contains spaces.Fixed the bug: failed to add a project
Example
A = 5b =->Return 5
Compiled JavaScript code:
(function () {var a, B;
A = 5;
b = function () {return 5;};). Call (this);
But we may have the need to define global variables, so Coffeescript still provides a declarative way to not exterminate global variables:
If you are like "to" create top-level variables for "Other scripts", attach them as properties on Windows, or on the Expor TS object in Commonjs. The existential operator (covered
writesProcessing WriteLinux Environment SetupRust Generation WriteData Structure assginment Data structure generationMIPS Generation WritingMachine Learning Job WritingOracle/sql/postgresql/pig database Generation/Generation/CoachingWeb development, Web development, Web site jobsAsp. NET Web site developmentFinance insurace Statistics Statistics, regression, iterationProlog writeComputer Computational Method GenerationBecause of professional, so trustworthy. If necessary, please add qq:99515681
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.