GithubHelp home page GithubHelp logo

marcwan / angularlivelessons Goto Github PK

View Code? Open in Web Editor NEW
31.0 31.0 37.0 378 KB

LiveLessons for Angular (6+). If you are looking for AngularJS, go to AngularJSLiveLessons

JavaScript 5.90% TypeScript 67.90% HTML 17.72% CSS 8.48%

angularlivelessons's People

Contributors

marcwan 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angularlivelessons's Issues

Video 20 model folder

I am enjoying a well presented video introduction to Angular. I'm completely new to Angular.

I am using Safaribooksonline.com video 20, 'Create a model for your recipe app'

The editor (in the video) contains a model folder which has recipe.ts
This is not present in my editor.

Is this due a different version of Angular?
How does the model folder get created?

=============================
My machine details:
Angular 5

"private": true,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular/cli": "1.5.4",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
}
}

Question: Is there a way to still have the use of default photo if none is available, but still use *ngIf binding?

I kind of liked having a default photo if none was added to a recipe, but still want to use the class binding that contains the img tag. I see that *ngIf can handle an if...else, but I cannot seem to get it to work. I tried:

and also:

)

but keep getting this error:

Error: src/app/components/recipe-summary/recipe-summary.component.html:4:41 - error NG5002: Parser Error: Unexpected token / at column 50 in [recipe.cover_photo; then recipe.cover_photo else /assets/emptybowl.jpg] in D:/Documents/Learning/Web/Angular/recipes/src/app/components/recipe-summary/recipe-summary.component.html@3:40

4 <div class='cover-photo-holder' *ngIf="recipe.cover_photo; then recipe.cover_photo else /assets/emptybowl.jpg">

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.