Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(header): replace logo.png with logo.svg #2874

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
325908d
docs(guide/unit-testing): add expression example
siddii May 22, 2013
508d845
test(matchers): update toThrow matcher
vojtajina May 24, 2013
6467250
feat(ngError): add error message compression and better error messages
IgorMinar May 24, 2013
f247217
feat($compile): support multi-element directive
mhevery May 24, 2013
513e79a
feat(ngdocs): provide support for inline variable hinting
matsko May 21, 2013
f004b87
docs(): Rectify animator.animate documentation
May 23, 2013
afc325c
fix($animator): ensure $animator calculates the highest duration + de…
matsko May 27, 2013
44946f9
fix(jqLite): Added optional name arg in removeData
jeffbcross May 29, 2013
cd3410a
chore(docs): add reference to the blog
lgalfaso May 25, 2013
c72bec5
fix(ngController): fix indentation bug which causes example to mess up
matsko May 23, 2013
738bf56
docs(overview.ngdoc): clarify wording
adamshaylor May 23, 2013
18ca265
docs(guide): format snippets of code in plain text
thewarpaint May 21, 2013
23c4df6
docs(input): provide explanation of how ngModel will affect the local…
mrlucmorin Jun 4, 2013
d3fd671
docs(validate-commit-msg): fix incorrect comment
JensRantil May 23, 2013
95bd140
docs(guide/di): fix some small grammatical issues
May 23, 2013
a8f8b03
docs(guide/compiler): fix some minor language errors
manuelkiessling May 23, 2013
c05e06c
docs(guide/understanding_model): improve example consistency
May 24, 2013
7816321
docs(guide/concepts): add comment as a type of directive
eghandhari May 24, 2013
ae3104c
docs(ngClass): clarify the use of object map
mrlucmorin May 28, 2013
7fa4ffd
docs(index): make menu links relative
siddii May 22, 2013
560e28f
docs(sanitize): add @description section
May 29, 2013
bcee59d
docs(angular-mocks): fix typo in example
May 30, 2013
41ebf0a
docs(header): replace logo.png with logo.svg
appsforartists Jul 15, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ angularFiles = {
'src/AngularPublic.js',
'src/jqLite.js',
'src/apis.js',
'src/ngError.js',

'src/auto/injector.js',

Expand Down
23 changes: 11 additions & 12 deletions docs/content/guide/compiler.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

Angular's {@link api/ng.$compile HTML compiler} allows the developer to teach the
browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute
and even create new HTML element or attributes with custom behavior. Angular calls these behavior
and even create new HTML elements or attributes with custom behavior. Angular calls these behavior
extensions {@link api/ng.$compileProvider#directive directives}.

HTML has a lot of constructs for formatting the HTML for static documents in a declarative fashion.
For example if something needs to be centered, there is no need to provide instructions to the
browser how the window size needs to be divided in half so that center is found, and that this
center needs to be aligned with the text's center. Simply add `align="center"` attribute to any
browser how the window size needs to be divided in half so that the center is found, and that this
center needs to be aligned with the text's center. Simply add an `align="center"` attribute to any
element to achieve the desired behavior. Such is the power of declarative language.

But the declarative language is also limited, since it does not allow you to teach the browser new
syntax. For example there is no easy way to get the browser to align the text at 1/3 the position
instead of 1/2. What is needed is a way to teach browser new HTML syntax.
instead of 1/2. What is needed is a way to teach the browser new HTML syntax.

Angular comes pre-bundled with common directives which are useful for building any app. We also
expect that you will create directives that are specific to your app. These extension become a
expect that you will create directives that are specific to your app. These extensions become a
Domain Specific Language for building your application.

All of this compilation takes place in the web browser; no server side or pre-compilation step is
Expand All @@ -39,17 +39,16 @@ process happens in two phases.
scope model are reflected in the view, and any user interactions with the view are reflected
in the scope model. This makes the scope model the single source of truth.

Some directives such {@link api/ng.directive:ngRepeat
`ng-repeat`} clone DOM elements once for each item in collection. Having a compile and link phase
improves performance since the cloned template only needs to be compiled once, and then linked
once for each clone instance.
Some directives such as {@link api/ng.directive:ngRepeat `ng-repeat`} clone DOM elements once
for each item in a collection. Having a compile and link phase improves performance since the
cloned template only needs to be compiled once, and then linked once for each clone instance.


# Directive

A directive is a behavior which should be triggered when specific HTML constructs are encountered in
the compilation process. The directives can be placed in element names, attributes, class names, as
well as comments. Here are some equivalent examples of invoking the {@link
A directive is a behavior which should be triggered when specific HTML constructs are encountered
during the compilation process. The directives can be placed in element names, attributes, class
names, as well as comments. Here are some equivalent examples of invoking the {@link
api/ng.directive:ngBind `ng-bind`} directive.

<pre>
Expand Down
2 changes: 1 addition & 1 deletion docs/content/guide/concepts.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ rendering the view compared to most other templating systems.
# Directives

A directive is a behavior or DOM transformation which is triggered by the presence of a custom attribute,
element name, or a class name. A directive allows you to extend the HTML vocabulary in a
element name, class name or comment. A directive allows you to extend the HTML vocabulary in a
declarative fashion. Following is an example which enables data-binding for the `contenteditable`
in HTML.

Expand Down
18 changes: 11 additions & 7 deletions docs/content/guide/dev_guide.mvc.understanding_controller.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ constructor). Constructors are always applied to an existing scope object.

You set up the initial state of a scope by creating model properties. For example:

function GreetingCtrl($scope) {
$scope.greeting = 'Hola!';
}
<pre>
function GreetingCtrl($scope) {
$scope.greeting = 'Hola!';
}
</pre>

The `GreetingCtrl` controller creates a `greeting` model which can be referred to in a template.

Expand All @@ -32,11 +34,13 @@ in the global scope. This is only for demonstration purposes - in a real
application you should use the `.controller` method of your Angular module for
your application as follows:

var myApp = angular.module('myApp',[]);
<pre>
var myApp = angular.module('myApp',[]);

myApp.controller('GreetingCtrl', ['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
myApp.controller('GreetingCtrl', ['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);
</pre>

Note also that we use the array notation to explicitly specify the dependency
of the controller on the `$scope` service provided by Angular.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/guide/dev_guide.mvc.understanding_model.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ occurs in controllers:

* Use an {@link expression angular expression} with an assignment operator in templates:

<button ng-click="{{foo='ball'}}">Click me</button>
<button ng-click="{{foo='bar'}}">Click me</button>

* Use {@link api/ng.directive:ngInit ngInit directive} in templates (for toy/example apps
only, not recommended for real applications):
Expand Down
26 changes: 7 additions & 19 deletions docs/content/guide/dev_guide.unit-testing.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ app.directive('aGreatEye', function () {
return {
restrict: 'E',
replace: true,
template: '<h1>lidless, wreathed in flame</h1>'
template: '<h1>lidless, wreathed in flame, {{1 + 1}} times</h1>'
};
});
</pre>

This directive is used as a tag `<a-great-eye></a-great-eye>`. It replaces the entire tag with the
template `<h1>lidless, wreathed in flame</h1>`. Now we are going to write a jasmine unit test to
verify this functionality.
template `<h1>lidless, wreathed in flame, {{1 + 1}} times</h1>`. Now we are going to write a jasmine unit test to
verify this functionality. Note that the expression `{{1 + 1}}` times will also be evaluated in the rendered content.

<pre>
describe('Unit testing great quotes', function() {
Expand All @@ -322,30 +322,18 @@ describe('Unit testing great quotes', function() {
it('Replaces the element with the appropriate content', function() {
// Compile a piece of HTML containing the directive
var element = $compile("<a-great-eye></a-great-eye>")($rootScope);
// fire all the watches, so the scope expression {{1 + 1}} will be evaluated
$rootScope.$digest();
// Check that the compiled element contains the templated content
expect(element.html()).toContain("lidless, wreathed in flame");
expect(element.html()).toContain("lidless, wreathed in flame, 2 times");
});
});
</pre>

We inject the $compile service and $rootScope before each jasmine test. The $compile service is used
to render the aGreatEye directive. After rendering the directive we ensure that the directive has
replaced the content and "lidless, wreathed in flame" is present.
replaced the content and "lidless, wreathed in flame, 2 times" is present.

## Mocks
oue

## Global State Isolation
oue

# Preferred way of Testing
uo

## JavaScriptTestDriver
ou

## Jasmine
ou

## Sample project
See the {@link https://github.com/angular/angular-seed angular-seed} project for an example.
Expand Down
6 changes: 3 additions & 3 deletions docs/content/guide/di.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ dependency lookup responsibility to the injector by declaring the dependencies a

Notice that by having the `ng-controller` instantiate the class, it can satisfy all of the
dependencies of `MyController` without the controller ever knowing about the injector. This is
the best outcome. The application code simply ask for the dependencies it needs, without having to
the best outcome. The application code simply asks for the dependencies it needs, without having to
deal with the injector. This setup does not break the Law of Demeter.

# Dependency Annotation

How does the injector know what service needs to be injected?
How does the injector know what service needs to be injected?

The application developer needs to provide annotation information that the injector uses in order
to resolve the dependencies. Throughout Angular certain API functions are invoked using the
Expand Down Expand Up @@ -137,7 +137,7 @@ http://www.pretotyping.org/ pretotyping}, and demo applications.
# `$inject` Annotation

To allow the minifers to rename the function parameters and still be able to inject right services
the function needs to be annotate with the `$inject` property. The `$inject` property is an array
the function needs to be annotated with the `$inject` property. The `$inject` property is an array
of service names to inject.

<pre>
Expand Down
28 changes: 14 additions & 14 deletions docs/content/guide/overview.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template
language and lets you extend HTML's syntax to express your application's components clearly and
succinctly. Out of the box, it eliminates much of the code you currently write through data
binding and dependency injection. And it all happens in JavaScript within the browser making it an
ideal partner with any server technology.
binding and dependency injection. And it all happens in JavaScript within the browser, making it
an ideal partner with any server technology.

Angular is what HTML would have been had it been designed for applications. HTML is a great
declarative language for static documents. It does not contain much in the way of creating
applications, and as a result building web applications is an exercise in *what do I have to do, so
that I trick the browser in to doing what I want.*
applications, and as a result building web applications is an exercise in *what do I have to do
to trick the browser into doing what I want.*

The impedance mismatch between dynamic applications and static documents is often solved as:
The impedance mismatch between dynamic applications and static documents is often solved with:

* **library** - a collection of functions which are useful when writing web apps. Your code is
* **a library** - a collection of functions which are useful when writing web apps. Your code is
in charge and it calls into the library when it sees fit. E.g., `jQuery`.
* **frameworks** - a particular implementation of a web application, where your code fills in
the details. The framework is in charge and it calls into your code when it needs something
app specific. E.g., `knockout`, `sproutcore`, etc.
app specific. E.g., `knockout`, `ember`, etc.


Angular takes another approach. It attempts to minimize the impedance mismatch between document
centric HTML and what an application needs by creating new HTML constructs. Angular teaches the
browser new syntax through a construct we call directives. Examples include:

* Data binding as in `{{}}`.
* Data binding, as in `{{}}`.
* DOM control structures for repeating/hiding DOM fragments.
* Support for forms and form validation.
* Attaching code-behind to DOM elements.
* Grouping of HTML into reusable components.



## End-to-end solution
## A complete client-side solution

Angular tries to be an end-to-end solution, when building a web application. This means it is
not a single piece in an overall puzzle of building a web application, but an end-to-end solution.
This makes Angular opinionated about how a CRUD application should be built. But while it is
opinionated, it also tries to make sure that its opinion is just a starting point, which you can
easily change. Angular comes with the following out-of-the-box:
Angular is not a single piece in the overall puzzle of building the client-side of a web
application. It handles all of the DOM and AJAX glue code you once wrote by hand and puts it in a
well-defined structure. This makes Angular opinionated about how a CRUD application should be
built. But while it is opinionated, it also tries to make sure that its opinion is just a
starting point you can easily change. Angular comes with the following out-of-the-box:

* Everything you need to build a CRUD app in a cohesive set: data-binding, basic templating
directives, form validation, routing, deep-linking, reusable components, dependency injection.
Expand Down
Binary file removed docs/img/AngularJS-small.png
Binary file not shown.
41 changes: 41 additions & 0 deletions docs/img/angular_logo_for_dark_background_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/spec/ngdocSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ describe('ngdoc', function() {
toMatch('</pre>\n\n<h1 id="one">One</h1>\n\n<pre');
});

it('should replace inline variable type hints', function() {
expect(new Doc().markdown('{@type string}')).
toMatch(/<a\s+.*?class=".*?type-hint type-hint-string.*?".*?>/);
});

it('should ignore nested doc widgets', function() {
expect(new Doc().markdown(
'before<div class="tabbable">\n' +
Expand Down
4 changes: 4 additions & 0 deletions docs/src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ Doc.prototype = {
(title || url).replace(/^#/g, '').replace(/\n/g, ' ') +
(isAngular ? '</code>' : '') +
'</a>';
}).
replace(/{@type\s+(\S+)(?:\s+(\S+))?}/g, function(_, type, url) {
url = url || '#';
return '<a href="' + url + '" class="' + self.prepare_type_hint_class_name(type) + '">' + type + '</a>';
});
});
text = parts.join('');
Expand Down
5 changes: 0 additions & 5 deletions docs/src/templates/css/docs.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
img.AngularJS-small {
width: 95px;
height: 25px;
}

/* this is here to avoid the display=block shuffling of ngShow */
.breadcrumb li > * {
float:left;
Expand Down
14 changes: 10 additions & 4 deletions docs/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@
<div class="navbar-inner">
<div class="container">
<a class="brand" href="http://angularjs.org" style="padding-top: 6px; padding-bottom: 0px;">
<img class="AngularJS-small" src="http://angularjs.org/img/AngularJS-small.png">
<img
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these src URLs relative so that they work when used locally or on CI server. See http://ci.angularjs.org/job/angular.js-pete/181/artifact/build/docs/api

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to. I'm only using absolute paths because they were like that when I got there. =) Relative is much nicer.

Your link is 404ing, but this one is still using the PNG. Is that link being written by a build script?

Also, how would you like that path to be written? I imagine it should be something like "/img/path.svg", but then you'd have a hole in your Jenkins build, since docs isn't mounted on /. Is there a variable I could use, like {{ IMG_PATH }}?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yours 404s as well :-) This is because Angular is rewriting the URL and the CI server is not setup to redirect deep URLs!
Try this, which is probably the same at the moment as yours anyway: http://ci.angularjs.org/job/angular.js-pete/181/artifact/build/docs/index.html
These pages are generated on every build. The CI server watches my github repos and builds and tests on changes.
You can do this locally with grunt docs or something.
The relative path can actually just be img/path.svg, without the / at the start. This works for the links in the navigation menu.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the source in /docs and didn't see any part that would dynamically rewrite the relative URL. I also tried grunt docs, and it was still relative after the build.

I cringed when I first saw the hardcoded link too, but I think I understand now why it's done. The images on angularjs.org probably don't change much, so even if you are technically pulling in a production image, everything still looks OK on staging. On the other hand, since the header is in index.html (and not one of the ngdoc pages), it doesn't get built, so there's no opportunity in the current setup to rewrite that link.

Moreover, since the fallback is done in JS, we'd need a token (like {{ IMAGES_PATH }}) to be able to make sure the base URL was put in the correct place in both the src and onerror attributes. Another option would be to use a <base/> tag in index.html.

Please let me know if I am mistaken, but I think what's best for now is to follow the existing convention and use the hard-coded link, unless there's an opportunity to let the build script handle it that I don't know about.

width="95"
height="25"
src="img/angular_logo_for_dark_background_small.svg"
onerror="this.src = 'img/AngularJS-small.png'"
>
</a>
<ul class="nav">
<li class="divider-vertical"></li>
Expand All @@ -142,9 +147,9 @@
<i class="icon-book icon-white"></i> Develop <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="http://docs.angularjs.org/tutorial">Tutorial</a></li>
<li><a href="http://docs.angularjs.org/guide/">Developer Guide</a></li>
<li><a href="http://docs.angularjs.org/api/">API Reference</a></li>
<li><a href="./tutorial/">Tutorial</a></li>
<li><a href="./guide/">Developer Guide</a></li>
<li><a href="./api/">API Reference</a></li>
<li><a href="http://docs.angularjs.org/misc/contribute">Contribute</a></li>
<li><a href="http://code.angularjs.org/">Download</a></li>
</ul>
Expand All @@ -155,6 +160,7 @@
<i class="icon-comment icon-white"></i> Discuss <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="http://blog.angularjs.org">Blog</a></li>
<li><a href="http://groups.google.com/group/angular">Mailing List</a></li>
<li><a href="http://webchat.freenode.net/?channels=angularjs&uio=d4">Chat Room</a></li>
<li class="divider"></li>
Expand Down
Loading