# Upgrade angular version in UICommons

**URL:** <https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161>\
**Category:** Development\
**Tags:** angular, uicommons\
**Created:** [July 6, 2016, 2:27pm UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161 "2016-07-06T14:27:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [July 7, 2016, 3:44am UTC](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/4 "2016-07-07T03:44:42Z")

</div>

> [@darius](#):
>
> I’d support renaming this filter to “omrs-display” (and then upgrading angular), but someone will have to do the legwork of doing the communications around this, and helping code-heavy implementations that contribute to uicommons (e.g. PIH) to make the necessary changes on their end.

According to [Angular filter documentation](https://docs.angularjs.org/guide/filter), using a hyphen would not be any better:

> **Note:** Filter names must be valid angular Expressions identifiers, such as `uppercase` or `orderBy`. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores (`myapp_subsection_filterx`).

Would something like this work?

#### Phase One

1. Rename `omrs.display` filter to `omrsDisplay`
2. Deprecate `omrs.display’:

```javascript
.filter('omrs.display', function(omrsDisplayFilter) {
    return function(text) {
      console.log('OpenMRS Angular filter "omrs.display" is deprecated. See http://om.rs/omrsDisplay for details.');
      return omrsDisplayFilter(text);
    }
})

```

1. Backport these changes to all supported versions of `uicommons` module

#### Phase Two

Run these commands on any/all modules using Angular + uicommons (we’d point [Upgrade angular version in UICommons - Development - OpenMRS Talk](http://om.rs/omrsdisplay) to a wiki page with an explanation and these instructions):

```bash
$ find . -type f -print0 | xargs -0 sed -i '' 's/omrs\.display/omrsDisplay/g'
$ git commit -am "upgrade angular omrsDisplay filter"
$ git push

```

#### Final Phase

After key modules have been upgraded (could probably be done on the next version of `uicommons`, since modules can be patched with a single sed command), drop the deprecated `omrs.display` filter and you’re free to upgrade Angular.

---

_[View the full topic](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161)._
