Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
brienne
Developer Documentation
Commits
9720649e
Commit
9720649e
authored
7 years ago
by
totten
Browse files
Options
Downloads
Patches
Plain Diff
"AngularJS: Quick Start" -- Various tweaks
parent
63465e08
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/framework/angular/quickstart.md
+16
-18
16 additions, 18 deletions
docs/framework/angular/quickstart.md
with
16 additions
and
18 deletions
docs/framework/angular/quickstart.md
+
16
−
18
View file @
9720649e
...
...
@@ -37,42 +37,40 @@ Write ang/aboutme.css
is not required -- the option
`--am`
can specify a different name. This
can be useful if you want to organize your code into multiple modules.
!!! note "Note:
`ang/`
folder"
By convention, AngularJS source code is stored in the
`ang/`
folder, and
each item is named after its module. The convention is discussed in
more detail in
[
AngularJS: File Names
](
/framework/angular/files.md
)
The first file,
`ang/aboutme.ang.php`
, configures the file-loader:
The first file,
`ang/aboutme.ang.php`
, provides metadata for the PHP-based
file-loader, e.g.
```
php
return
array
(
'requires'
=>
array
(
'crmUi'
,
'crmUtil'
,
'ngRoute'
),
'js'
=>
array
(
'ang/aboutme.js'
,
'ang/aboutme/*.js'
,
'ang/aboutme/*/*.js'
,
),
'css'
=>
array
(
'ang/aboutme.css'
),
'requires'
=>
array
(
'ngRoute'
,
'crmUi'
,
'crmUtil'
),
'js'
=>
array
(
'ang/aboutme.js'
,
'ang/aboutme/*.js'
,
'ang/aboutme/*/*.js'
),
'css'
=>
array
(
'ang/aboutme.css'
),
'partials'
=>
array
(
'ang/aboutme'
),
'settings'
=>
array
(),
);
```
And the second file,
`ang/aboutme.js`
, declares the Angular module's dependencies.
The second file,
`ang/aboutme.js`
, provides metadata for the JS-based
Angular runtime, e.g.
```
js
angular
.
module
(
'
aboutme
'
,
[
'
crmUi
'
,
'
crmUtil
'
,
'
ngRoute
'
'
ngRoute
'
,
'
crmUi
'
,
'
crmUtil
'
]);
```
!!! tip "Tip: angular.module() and
angular.crmDepend
s()"
!!! tip "Tip: angular.module() and
CRM.angRequire
s()"
The list of dependencies is declared once in PHP and once in JS. To
remove this duplication,
change
`angular.module('aboutme',...)`
to
`angular.crmDepend
s('aboutme')
;
`
remove this duplication,
replace the array
`['ngRoute', 'crmUi', 'crmUtil']`
with a function call
`CRM.angRequire
s('aboutme')`
.
!!! note "Note:
`ang/`
folder"
By convention, AngularJS source code is stored in the
`ang/`
folder.
The convention is discussed in more detail in
[
AngularJS: File
Names
](
/framework/angular/files.md
)
## Add an Angular
route, etal
## Add an Angular
-based page
Now let's add a new Angular-based page. This page will require a
`route`
with a
`controller`
and an HTML template. The command
`civix
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment