apress / pro-angular-6 Goto Github PK
View Code? Open in Web Editor NEWSource Code for 'Pro Angular 6' by Adam Freeman
License: Other
Source Code for 'Pro Angular 6' by Adam Freeman
License: Other
page 154
following line should be in bold and previous line not in bold.
import { Order } from "./order.model";
I am trying to build prod but get that error:
ERROR in : Cannot determine the module for class CartSummaryComponent in D:/PROJECTS/sdtyn/pro-angular-6/SportsStore/src/app/store/cartSummary.component.ts! Add CartSummaryComponent to the NgModule to fix it.
I am using Angular-7.2.0 and I think it is a problem with Angular 7.
How can I fix this issue? Any idea?
Hi, I have error in this directive:
https://github.com/Apress/pro-angular-6/blob/master/07%20-%20SportsStore/SportsStore/src/app/store/counter.directive.ts
"The template context does not have an implicit value"
I'm using Angular 7, I know the author suggested to use specific version but there was a promise of "updating" the book and the source code.
At end of chapter 7 the app has undesirable behavior that on 'Home' selecting page 4 and then changing categories leaves no products showing. Suggested improvement below to store.component.ts
changeCategory(newCategory?: string) {
this.selectedCategory = newCategory
this.changePage(1);
}
When installing the @angular/pwa package with 'ng add @angular/pwa', I get the following error on the command line:
Invalid rule result: Instance of class Promise.
Going further in the chapter, it seems that some of the files that were supposed to be added are not present.
Any Ideas?
Translation:
When I finished chapter 9 of the book I got an error that I saw that in your github also that error comes out if you could solve it would be great. Thanks is a great book
ERROR:
PUT http://localhost:3500/orders/1 401 (Unauthorized)
ERROR HttpErrorResponse {headers: HttpHeaders, status: 401, statusText: "Unauthorized", url: "http://localhost:3500/orders/1", ok: false, …}
Git repository has the final code from each chapter. There is only single project in each chapter even though multiple topics are addressed. The resulting code is for the last project in the chapter. Am I missing something?
In the page of cartDetail.component.html, the code in the last tag lacks of closing div tag for the code:
<div class="col">
Although the code can run normally without the closing div tag. It's better to add it to prevent from confusing.
p. 11 when running : ng serve --port 3000 open
I got the following error.
Thank you very much.
PS C:\web\angularTest\todo\src> ng serve --port 3000 --open
** Angular Live Development Server is listening on localhost:3000, open your browser on http://localhost:3000/ **
10% building modules 6/6 modules 0 activei 「wds」: Project is running at http://localhost:3000/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to //index.html
Date: 2019-10-13T06:46:40.749Z
Hash: b287a6d9b0afddc8d6f3
Time: 1978ms
chunk {main} main.js, main.js.map (main) 354 kB [entry] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 354 kB [entry] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 513 kB [entry] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.5 kB [initial] [rendered]
ERROR in ../node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
../node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
../node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.
../node_modules/rxjs/internal/types.d.ts(82,52): error TS1005: ';' expected.
../node_modules/rxjs/internal/types.d.ts(82,88): error TS1005: ';' expected.
../node_modules/rxjs/internal/types.d.ts(82,92): error TS1109: Expression expected.
i 「wdm」: Failed to compile.
I don't know why, but this statement is not true, hence should be updated if possible:
Remember that navigation can be performed only by the application. If you change the URL directly in the browser’s URL bar, the browser will request the URL you enter from the web server.
Ps: it is possible to change the URL directly in the browser's URL bar and go to correct component template. (Angular 6)
You want to disable the "checkout" button when there is no connectivity, for line 66 so I think it should be
[disabled]="cart.lines.length == 0 || !connected">
Thanks!
I have problem with terms.guard.
import { Injectable } from "@angular/core";
import { ActivatedRouteSnapshot, RouterStateSnapshot, Router } from "@angular/router";
import { MessageService } from "./messages/message.service";
import { Message } from "./messages/message.model";
@Injectable()
export class TermsGuard {
constructor(private messages: MessageService,
private router: Router) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Promise | boolean {
if (route.params["mode"] == "create") {
return new Promise<boolean>((resolve, reject) => {
let responses: [string, (string) => void][] = [
["Yes", () => resolve(true)],
["No", () => resolve(false)]
];
this.messages.reportMessage(
new Message("Do you accept the terms & conditions?",
false, responses));
});
} else {
return true;
}
}
}
An error of the following type occurs:
ERROR in src/app/terms.guard.ts(27,32): error TS2345: Argument of type '[string, (string: any) => void][]' is not assignable to parameter of type '[string, (string: any) => void[]]'.
Property '0' is missing in type '[string, (string: any) => void][]'.
I am not very well versed in promises and therefore do not quite understand how to correct the error.
Chapter 7, listing 7-18
Is the code provided as Ch 5 and Ch 6 the code at the beginning or the end of the chapter? It is not clear to several people I've talked to. Some authors provide the end of chapter code, some the beginning.
In the "Preparing the example project" section the command to create the project shoud be:
ng new JavaScriptPrimer
I am using the book with Angular 7 so I appreciate this may be out of support.
(I am automatically upgrading the code for each chapter).
Thank you for providing the code for each Chapter (unlike some alternative videos/books) this makes a real difference if you get stuck in one chapter.
I get the following error in Chapter 8.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:3500/products
I get the same problem in Firefox 63 and Chrome 70, on Windows 10
Any suggestions? I think I need to change the REST server to send a header but I do not know the details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.