Skip to Main Content
Advanced TypeScript Programming Projects
book

Advanced TypeScript Programming Projects

by Peter O'Hanlon
July 2019
Intermediate to advanced content levelIntermediate to advanced
416 pages
10h 6m
English
Packt Publishing
Content preview from Advanced TypeScript Programming Projects

Modifying the HelloWorld component to support image classification

When we created our Vue application, the CLI helpfully created a HelloWorld.vue file for us containing the HelloWorld component. We are going to take advantage of the fact that we already have this component, and we are going to use it to classify a pre-loaded image. If we wanted to, we could use it to load images using a file upload component and drive the classifications when this changes.

Now, let's take a look at what our HelloWorld TypeScript code looks like. Obviously, we are going to start with a class definition. Just like we saw earlier, we have marked this with the @Component decorator to say that this is a component:

@Componentexport default class HelloWorld extends ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn TypeScript 3 by Building Web Applications

Learn TypeScript 3 by Building Web Applications

Sebastien Dubois, Alexis Georges

Publisher Resources

ISBN: 9781789133042Supplemental Content