{"id":17458119,"url":"https://github.com/pocesar/angular-track-height","last_synced_at":"2026-02-03T05:08:11.940Z","repository":{"id":36749816,"uuid":"41056450","full_name":"pocesar/angular-track-height","owner":"pocesar","description":"Watch an element for the min or/and max height then save it for use somewhere else","archived":false,"fork":false,"pushed_at":"2015-08-20T00:46:34.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-03T11:30:42.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pocesar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-19T19:49:01.000Z","updated_at":"2019-08-08T16:49:56.000Z","dependencies_parsed_at":"2022-09-09T19:01:21.713Z","dependency_job_id":null,"html_url":"https://github.com/pocesar/angular-track-height","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-track-height","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-track-height/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-track-height/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-track-height/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pocesar","download_url":"https://codeload.github.com/pocesar/angular-track-height/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pocesar%2Fangular-track-height/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258785007,"owners_count":22757659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T03:54:50.159Z","updated_at":"2026-02-03T05:08:06.921Z","avatar_url":"https://github.com/pocesar.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Angular Track Height\n\nWatch an element for the min or/and max height then save it for use somewhere else\n\nMostly to avoid flicker on ui-view/ng-view when it changes height.\n\n## Install\n\n### Bower\n\n```bash\n$ bower install angular-track-height --save\n```\n\n### NPM\n\n```bash\n$ npm install angular-track-height --save\n```\n\nRequires requestAnimationFrame\n\n## Usage\n\n### Directives\n\n#### track-height\n\nTracks the height of an element for usage somewhere else, like inside a controller or inside other directives.\n\n```html\n\u003cdiv track-height=\"{{ ctrl.nameit }}\" class=\"some-element\" ui-view=\"\"\u003e\u003c/div\u003e\n```\n\n#### track-height-apply\n\nYou can set the min and max, depending on the options you pass to it.\n\nBy passing \"min\", the `min-height` will be set to the mininum value the element ever had (can be 0)\n\nBy passing \"max\", the `min-height` will be set to the max value the element ever had\n\nBy passing \"min max\", the `height` will be set to the max value the element ever had (might have problems with heavily responsive elements)\n\n```html\n\u003cdiv track-height=\"nameit\" track-height-apply=\"min max\" class=\"some-element\" ui-view=\"\"\u003e\u003c/div\u003e\n```\n\n### Service\n\n#### TrackHeight\n\nYou can access your element height using this service, by the name you provide\n\n##### `.get`\n\nGets the min or max height of an element\n\n##### `.set`\n\nProgramatically sets the min or max height of an element\n\n```js\nangular\n.module('App', [\n  'TrackHeight'\n])\n.controller('yourcontroller', ['TrackHeight', function(TrackHeight){\n  var heights = TrackHeight.get('nameit');\n  // heights.min / heights.max / heights.current;\n  TrackHeight.set('nameit', {\n    min: 10,\n    max: 100,\n    current: 50\n  });\n});\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangular-track-height","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpocesar%2Fangular-track-height","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpocesar%2Fangular-track-height/lists"}