# hr.view

> Views and templating utility for HappyRhino

Latest version **1.0.1** (published 2015-04-18) · 0 weekly downloads

## Install

```sh
npm install hr.view
pnpm add hr.view
yarn add hr.view
bun add hr.view
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-04-18 |
| First published | 2015-04-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | samypesse |

## Links

- npm: https://www.npmjs.com/package/hr.view
- Repository: https://github.com/HappyRhino/hr.view
- Issues: https://github.com/HappyRhino/hr.view/issues
- npm.io page: https://npm.io/package/hr.view

## Dependencies (6)

- [q](https://npm.io/package/q.md) *
- [jquery](https://npm.io/package/jquery.md) *
- [hr.class](https://npm.io/package/hr.class.md) >=1.2.3
- [hr.model](https://npm.io/package/hr.model.md) *
- [hr.queue](https://npm.io/package/hr.queue.md) *
- [hr.utils](https://npm.io/package/hr.utils.md) *

## Recent versions

- 1.0.1 (latest) — 2015-04-18
- 1.0.0 — 2015-04-17
- 0.2.0 — 2015-04-16
- 0.1.1 — 2015-04-05
- 0.1.0 — 2015-04-04

## README

hr.view [![Build Status](https://travis-ci.org/HappyRhino/hr.view.png?branch=master)](https://travis-ci.org/HappyRhino/hr.view)
=============================

> Views and templating utility

## Installation

```
$ npm install hr.view
```

### Documentation

#### Creation

Create a new view by extending the default `View`:

```js
var View = require("hr.view");

var MyView = View.extend({
    tagName: "div",
    className: "my-view",

    render: function() {
        this.html("So cool!");
        return this.ready();
    }
});
```

#### Append to the dom

```js
var view = new MyView();
view.appendTo("body");
```

#### Templating

```js
var View = require("hr.view");

// or View.Template.extend(...)
var MyView = View.mixin(View.Template).extend({
    template: "My name is <%- name %>",
    templateContext: function() {
        return {
            name: this.model.get("name")
        }
    }
});

var view = new MyView({
    model: new Model({}, { name: "Samy" })
});
view.update();
view.appendTo("body");
```

---
_Source: https://npm.io/package/hr.view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
