<form role="form" method="POST" action="{{ url('/roles/save') }}" data-ng-app="">
<div class="form-group">
<label>Page-Title:</label>
<input type="text" required value="" data-ng-model="title" name="page_title" class="form-control">
</div>
<div class="form-group">
<label>Page-Alias:</label>
<input type="text" value="@{{ title }}" name="page_alias" class="form-control">
</div>
I am new to angular and using simple data-binding so that whenever a user enters the page title the alias gets auto generated but I want to identify the spaces and replace them with a "-" (dash) . For example: whenever the user enters Home Page I want the alias to be Home-Page and even better if it's home-page. I tried doing this
<input type="text" value="@{{title.replace(/-/g, ' ');}} name="page_alias" class="form-control">
but it doesn't work.