Git Product home page Git Product logo

angular-using-event-directives-lab-g-416's Introduction

Using event based Directives

Objectives

  • Write a Controller function to update the View
  • Use ng-click to run the Controller function

Instructions

We've prepared the base structure for our application in this repo. Clone the repo, and have a look around the code.

We've got a very basic VoteController - this deals with users adding and removing votes.

We also have the vote count displayed on the page, with two buttons to modify the vote count (but don't work).

Your task is to make these two buttons work - incrementing and decrementing the view count accordingly. The buttons should make reference to the incrementVotes and decrementVotes functions provided for you in the controller.

Bonus task: Only allow the user to affect the vote count by +/- 1. For example, once they've added a vote, if they try to add another vote it should remove their original vote (acting as a toggle). If they remove a vote, it should only work once. From 5 votes, the user should only be able to make the total either 4, 5 or 6.

View Angular Using Event Based Directives Lab on Learn.co and start learning to code for free.

View Using Event Based Directives Lab on Learn.co and start learning to code for free.

angular-using-event-directives-lab-g-416's People

Contributors

annjohn avatar ipc103 avatar lizdenhup avatar pajamaw avatar seemajune avatar toddmotto avatar

Watchers

 avatar

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.