<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 still learning Angular and experimenting with simple data-binding. I want to automatically generate an alias when a user enters the page title by replacing spaces with dashes. For example, if the user enters "Home Page," I would like the alias to be "Home-Page" or even "home-page." Below is my attempt:
<input type="text" value="@{{title.replace(/-/g, ' ');}} name="page_alias" class="form-control">
Unfortunately, it doesn't seem to be working as intended yet.