GithubHelp home page GithubHelp logo

angular / angular.js Goto Github PK

View Code? Open in Web Editor NEW
58.9K 3.8K 27.6K 99.41 MB

AngularJS - HTML enhanced for web apps!

Home Page: https://angularjs.org

License: MIT License

JavaScript 98.17% HTML 1.22% Shell 0.46% CSS 0.05% BitBake 0.10%

angular.js's Introduction

AngularJS CircleCI

AngularJS lets you write client-side web applications as if you had a smarter browser. It lets you use good old HTML (or HAML, Jade/Pug and friends!) as your template language and lets you extend HTML’s syntax to express your application’s components clearly and succinctly. It automatically synchronizes data from your UI (view) with your JavaScript objects (model) through 2-way data binding. To help you structure your application better and make it easy to test, AngularJS teaches the browser how to do dependency injection and inversion of control.

It also helps with server-side communication, taming async callbacks with promises and deferred objects, and it makes client-side navigation and deep linking with hashbang urls or HTML5 pushState a piece of cake. Best of all? It makes development fun!


AngularJS support has officially ended as of January 2022. See what ending support means and read the end of life announcement.

Visit angular.io for the actively supported Angular.


Documentation

Go to https://docs.angularjs.org

Contribute

We've set up a separate document for our contribution guidelines.

Develop

We've set up a separate document for developers.

Analytics

What to use AngularJS for and when to use it

AngularJS is the next generation framework where each component is designed to work with every other component in an interconnected way like a well-oiled machine. AngularJS is JavaScript MVC made easy and done right. (Well it is not really MVC, read on, to understand what this means.)

MVC, no, MV* done the right way!

MVC, short for Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the different parts of an application separated for proper readability and debugging. Model is the data and the database. View is the user interface and what the user sees. Controller is the main link between Model and View. These are the three pillars of major programming frameworks present on the market today. On the other hand AngularJS works on MV*, short for Model-View-Whatever. The Whatever is AngularJS's way of telling that you may create any kind of linking between the Model and the View here.

Unlike other frameworks in any programming language, where MVC, the three separate components, each one has to be written and then connected by the programmer, AngularJS helps the programmer by asking him/her to just create these and everything else will be taken care of by AngularJS.

Interconnection with HTML at the root level

AngularJS uses HTML to define the user's interface. AngularJS also enables the programmer to write new HTML tags (AngularJS Directives) and increase the readability and understandability of the HTML code. Directives are AngularJS’s way of bringing additional functionality to HTML. Directives achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY (Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the application.

HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where to load the app, which components or controllers to use for each element, etc. We specify "what" gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various moving parts, we simply define what we want and AngularJS will take care of the dependencies.

Data Handling made simple

Data and Data Models in AngularJS are plain JavaScript objects and one can add and change properties directly on it and loop over objects and arrays at will.

Two-way Data Binding

One of AngularJS's strongest features. Two-way Data Binding means that if something changes in the Model, the change gets reflected in the View instantaneously, and the same happens the other way around. This is also referred to as Reactive Programming, i.e. suppose a = b + c is being programmed and after this, if the value of b and/or c is changed then the value of a will be automatically updated to reflect the change. AngularJS uses its "scopes" as a glue between the Model and View and makes these updates in one available for the other.

Less Written Code and Easily Maintainable Code

Everything in AngularJS is created to enable the programmer to end up writing less code that is easily maintainable and readable by any other new person on the team. Believe it or not, one can write a complete working two-way data binded application in less than 10 lines of code. Try and see for yourself!

Testing Ready

AngularJS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies to its controllers and services whenever required. This helps in making the AngularJS code ready for unit testing by making use of mock dependencies created and injected. This makes AngularJS more modular and easily testable thus in turn helping a team create more robust applications.

angular.js's People

Contributors

brettcannon avatar btford avatar caitp avatar chirayuk avatar esprehn avatar frederikprijck avatar gkalpak avatar hzoo avatar igorminar avatar jbedard avatar jdavisp3 avatar jeffbcross avatar juliemr avatar ksheedlo avatar lgalfaso avatar matsko avatar mernen avatar mgol avatar mhevery avatar narretz avatar petebacondarwin avatar pkozlowski-opensource avatar realityking avatar rodyhaddad avatar sekibomazic avatar shahata avatar tbosch avatar thorn0 avatar vojtajina avatar wesleycho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular.js's Issues

Add DSL to retrieve current URL

Currently, there is no way to find out the current URL on an end-to-end test.

Elliot's draft on this feature:
angular.scenario.dsl('applicationUrl', function() {
return function() {
this.addFutureAction('get application url', function($window, $document, done) {
done(null, $window.location.href);
});
};
});

expect(applicationUrl()).toEqual('...')

Debug "dump" filter

We should create dump filter for displaying variables.
This filter should be able to dump even window or document object...

fromJson fails if string contains quotes

there are two issues:

1/ failure to parse string with escaped double quote ("), e.g. "

20:46:29:659: Lexer Error: Unexpected next character ["asdfasdf""}]] in expression '[{"at":1287891981735,"msg":"what?"},{"at":1287891984055,"msg":"lala"},{"at":1287891988278,"msg":"haha"asdfasdf""}]' at column '102.00000000000003'.

2/ failure to parse string with single quote ('), e.g. {"at":1287875160522,"msg":"what's up?"}

20:45:00:634: Lexer Error: Unterminated quote ['s up?"}]] starting at column '72.00000000000003' in expression '[{"at":1287875144138,"msg":"ate lunch"},{"at":1287875160522,"msg":"what's up?"}]'.

angular.fromJson not safe

As mentioned before, the use of the Parser to serialize JSON is not safe. The following code will execute:

angular.fromJson("{'res':([1,2,3]['constructor']'constructor'())}").res

If the JSON string happened to be user-supplied it would execute code. An approach similar to json.org should be used.

use new Function instead of eval

in the getterFn method I see the following line:
fn = eval('fn = ' + code);
I think it would be better if it was
fn = new Function(code,'key');

Filter.date - two tests fail (probably because of different timezone)

Total 496 tests (Passed: 494; Fails: 2; Errors: 0) (1313.00 ms)
Firefox 3.6.11 Mac OS: Run 496 tests (Passed: 494; Fails: 2; Errors 0) (1313.00 ms)
filter date.test that it should accept format failed (3.00 ms): Expected '2010-9-4 12=0:5:8am0700' to equal '2010-9-3 12=0:5:8am0700'.
([object Object])@http://localhost:9876/test/lib/jasmine-jstd-adapter/JasmineAdapter.js:102
([object Object])@http://localhost:9876/test/lib/jasmine-1.0.1/jasmine.js:1909
("2010-9-3 12=0:5:8am0700")@http://localhost:9876/test/lib/jasmine-1.0.1/jasmine.js:1145
()@http://localhost:9876/test/test/FiltersSpec.js:115
()@http://localhost:9876/test/lib/jasmine-jstd-adapter/JasmineAdapter.js:70

filter date.test that it should accept miliseconds as date failed (3.00 ms): Expected '1970' to equal '1969'.
  ([object Object])@http://localhost:9876/test/lib/jasmine-jstd-adapter/JasmineAdapter.js:102
  ([object Object])@http://localhost:9876/test/lib/jasmine-1.0.1/jasmine.js:1909
  ("1969")@http://localhost:9876/test/lib/jasmine-1.0.1/jasmine.js:1145
  ()@http://localhost:9876/test/test/FiltersSpec.js:126
  ()@http://localhost:9876/test/lib/jasmine-jstd-adapter/JasmineAdapter.js:70

infinite loop when location hash is set to empty

in any angular app open the main html and append # to it in the address bar and open the page. e.g. file://..../example/temp.html#

the browser will keep on reloading the page like crazy.

No routes definition or onChange handlers are needed for this to be reproducible. Affects all browsers.

Add element().text() to e2e DSL

The only way to retrieve the text of an element at the moment is by using .query(), which is overly complex for such a simple operation.

.text() should return the trimmed text of the element.

use new Function instead of eval

in the getterFn method I see the following line:
fn = eval('fn = ' + code);
I think it would be better if it was
fn = new Function(code,'key');

readString consumes invalid escapes

readString consumes invalid escapes:

     string += String.fromCharCode(parseInt(hex, 16));

hex is not verified to be a valid string, the parser should throw an error the following string ({"x":["\u1","Secret"]})

use new Function instead of eval

in the getterFn method I see the following line:
fn = eval('fn = ' + code);
I think it would be better if it was
fn = new Function(code,'key');

Scenario runner should print line# for steps

instead of:

585ms navigate to ../personalLog.html
15ms input 'newMsg' enter 'my first message'
51ms element form input[type="submit"] click
4ms repeater ul li count
4ms expect repeater ul li count toEqual 1

I'd like to see line numbers from my spec file next to each (or at least next to each failing) step like this:

585ms #20 navigate to ../personalLog.html 15ms #34 input 'newMsg' enter 'my first message' 51ms #35 element form input[type="submit"] click 4ms #37 repeater ul li count 4ms #38 expect repeater ul li count toEqual 1

This would allow me to locate failing steps a lot faster than now when I have to compare strings in the runner with code in the spec.

$location needs method you call on updates, properties should be treated as read only

  • $location.update('/Hash/25/Path/26'); // just the path
  • $location.update({param1: 'A', param2: 'B'}); // just the query string
  • $location.update('/Hash/25/Path/26', {param1: 'A', param2: 'B'}); // both

Per discussion parse() could be updated to do that, but "parse" is not a very clear name for what a developer is attempting to do.

"update" or "navigate" would both be much more clear.

use new Function instead of eval

in the getterFn method I see the following line:
fn = eval('fn = ' + code);
I think it would be better if it was
fn = new Function(code,'key');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.