<commit_before># sdw-viewmodel

A View Model that watches routes and binds them to cascading states in your app.

## Example

View

```html
<body ng-controller='DemoController'>
  <section sdw-viewmodel='vm'>
    <div class='overlay' ng-show='vm.showModal'>
      <article ng-show='vm.article === "first"'>
        <h1>First</h1>
        <a href='#/article/{{ vm.article }}/buy'>Buy</a>
        <p ng-show='vm.showPrice'>$10.00</p>
      </article>
      <article ng-show='vm.article === "second"'>
        <h2>Second</h2>
        <a href='#/article/{{ vm.article }}/buy'>Buy</a>
        <p ng-show='vm.showPrice'>$14.00</p>
      </article>
    </div>
  </section>
</body>
```

Module

```js
angular
  .module('viewmodel.demo', ['sdw.viewmodel'])
  .config(function(viewmodelProvider) {

    viewmodelProvider
      .state('default', {
        route: '',
        action: function(vm, params) {
          vm.showModal = false;
          vm.article = '';
          vm.showPrice = false;
        }
      })
      .state('article', {
        route: '/article/:article',
        action: function(vm, params) {
          vm.showModal = true;
          vm.article = params.article;
        }
      })
      .state('article.buy', {
        route: '/buy',
        action: function(vm, params) {
          vm.showPrice = true;
        }
      });
  })
  .controller('DemoController', function($scope, $location, viewmodel) {

  });
```
<commit_msg>formatting<commit_after># sdw-viewmodel

A View Model that watches routes and binds them to cascading states in your app.

## Example

View

```html
<body ng-controller='DemoController'>
  <section sdw-viewmodel='vm'>
    <div class='overlay' ng-show='vm.showModal'>

      <article ng-show='vm.article === "first"'>
        <h1>First</h1>
        <a href='#/article/{{ vm.article }}/buy'>Buy</a>
        <p ng-show='vm.showPrice'>$10.00</p>
      </article>

      <article ng-show='vm.article === "second"'>
        <h2>Second</h2>
        <a href='#/article/{{ vm.article }}/buy'>Buy</a>
        <p ng-show='vm.showPrice'>$14.00</p>
      </article>

    </div>
  </section>
</body>
```

Module

```js
angular
  .module('viewmodel.demo', ['sdw.viewmodel'])
  .config(function(viewmodelProvider) {

    viewmodelProvider

      .state('default', {
        route: '',
        action: function(vm, params) {
          vm.showModal = false;
          vm.article = '';
          vm.showPrice = false;
        }
      })

      .state('article', {
        route: '/article/:article',
        action: function(vm, params) {
          vm.showModal = true;
          vm.article = params.article;
        }
      })

      .state('article.buy', {
        route: '/buy',
        action: function(vm, params) {
          vm.showPrice = true;
        }
      });
  })
  .controller('DemoController', function($scope, $location, viewmodel) {

  });
```

{'fraction_non_alphanumeric': 0.1832696980215203, 'fraction_numerical': 0.008330440819160014, 'mean_word_length': 2.1915836101882613, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2415579', 'n_tokens_mistral': 986, 'n_tokens_neox': 941, 'n_words': 182}