-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFR] Angular 1.6 #1297
[RFR] Angular 1.6 #1297
Changes from 9 commits
57b93dc
4544128
452712a
4494ecf
5fdc5bb
bcdc0a8
f320c13
0d1258f
5fa1d90
40a9be7
98d7102
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
# Upgrade to 1.0 | ||
|
||
## Angular 1.6 | ||
ng-admin is now ready for Angular 1.6 for security reasons and we strongly recommend you to migrate too. | ||
|
||
To do so you can follow the Angular Migration Guide [from 1.4 to 1.5](https://docs.angularjs.org/guide/migration#migrating-from-1-4-to-1-5) then [from 1.5 to 1.6](https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6). | ||
|
||
Here are the major changes we've faced: | ||
|
||
- The [default hash-prefix changed from `#/` to `#!/`](https://docs.angularjs.org/guide/migration#commit-aa077e8). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/- // |
||
For ng-admin we choose to keep the old prefix in order to avoid major changes in production or tests. | ||
You can do it too by adding a configuration block: | ||
|
||
```js | ||
$locationProvider.hashPrefix(''); | ||
``` | ||
|
||
- $http doesn't support its `.success` and `.error` functions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/$http/ |
||
|
||
```diff | ||
-$http.success(successFn).error(errorFn); | ||
+$http.then(successFn, errorFn); | ||
``` | ||
|
||
- No more arrow functiins in services and cintrollers. | ||
|
||
```diff | ||
-app.service(() => { | ||
+app.service(function () { | ||
/* service code */ | ||
}); | ||
``` | ||
|
||
## [BC Break] ng-admin now attaches to a named view | ||
|
||
Ng-admin used to attach to the following element in your main `index.html`: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,13 @@ | |
], | ||
"dependencies": { | ||
"admin-config": "~0.12.1", | ||
"angular": "~1.4.8", | ||
"angular": "~1.6.1", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Align angular-mocks version with this one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! |
||
"angular-numeraljs": "^1.1.6", | ||
"angular-sanitize": "^1.3.15", | ||
"angular-translate": "^2.11.0", | ||
"angular-ui-bootstrap": "~1.2.1", | ||
"angular-ui-codemirror": "jpetitcolas/ui-codemirror#di", | ||
"angular-ui-router": "^0.2.14", | ||
"angular-ui-router": "~0.4.0", | ||
"bootstrap-sass": "^3.3.7", | ||
"codemirror": "^5.2.0", | ||
"core-js": "^0.6.1", | ||
|
@@ -42,7 +42,7 @@ | |
"ui-select": "0.18.1" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": "~1.4.8", | ||
"angular-mocks": "~1.6.1", | ||
"babel": "^6.5.2", | ||
"babel-cli": "^6.14.0", | ||
"babel-core": "^6.14.0", | ||
|
@@ -59,11 +59,13 @@ | |
"html-loader": "^0.3.0", | ||
"jasmine": "~2.4.1", | ||
"jasmine-core": "~2.4.1", | ||
"jasmine-spec-reporter": "^3.2.0", | ||
"jshint-stylish": "~0.1.3", | ||
"json-server": "~0.8.8", | ||
"karma": "~0.13.21", | ||
"karma-chrome-launcher": "~0.2.2", | ||
"karma-jasmine": "~0.3.7", | ||
"karma-mocha-reporter": "^2.2.1", | ||
"karma-ng-html2js-preprocessor": "~0.2.1", | ||
"karma-ng-scenario": "~0.1.0", | ||
"karma-phantomjs-launcher": "~1.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const location = ($locationProvider) => { | ||
// Keep the start of all routes to #/ instead of #!/ | ||
// while updating to Angular 1.6 | ||
// @see https://docs.angularjs.org/guide/migration#commit-aa077e8 | ||
$locationProvider.hashPrefix(''); | ||
}; | ||
|
||
location.$inject = ['$locationProvider']; | ||
|
||
export default location; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ then/, then/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/To do so/To do so,/